Home › Forums › General Issues › Control Display of Custom Field › Reply To: Control Display of Custom Field
Okay, I’ve tried the above using this method but the widget block just disappeared and doesn’t appear on ANY pages.
<?php
$excluded = get_field('excluded_pages_field', 1255, 1509, 1213, 1293, false);
global $post;
if( $excluded && !in_array($post->ID, $excluded) ){
$eventcontent = get_field('event_content', 1368);
$moredetails = get_field('more_details', 1368);
$eventimage = get_field('event_image', 1368);
if(!empty($eventcontent) ): ?>
<section class="boldSection gutter btBottomVertical btParallax">
<div class="specialevent" style="background: linear-gradient(to right, rgba(255,255,255,1) 0%,rgba(255,255,255,1) 16%,rgba(255,255,255,1) 50%,rgba(255,255,255,0.01) 52%,rgba(255,255,255,0) 55%), url(<?php echo $eventimage; ?>); background-size: cover!important; background-repeat: no-repeat!important; background-position: right center!important;">
<div class="col-sm-6">
<header class="header btDash bottomDash">
<div class="dash">
<h2>
<span class="headline">Special Event</span>
</h2>
</div>
</header>
<?php echo $eventcontent; ?>
<a href="<?php echo $moredetails; ?>" class="btBtn btBtn btnOutlineStyle btnAccentColor btnBig btnHalfWidth btnRightPosition btnNoIcon"><span class="btnInnerText">More Details</span></a><a href="about/season-tickets/" class="btBtn btBtn btnOutlineStyle btnAccentColor btnBig btnHalfWidth btnRightPosition btnNoIcon"><span class="btnInnerText">Get Tickets</span></a>
<div class="btClear btSeparator topSemiSpaced noBorder"><hr></div>
</div>
</div>
</section>
<?php endif; ?>
<?php } ?>
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.