Home Forums Front-end Issues Info is no longer showing on front of site


Info is no longer showing on front of site

  • Hi there, I inherited a website using ACF and am not a developer. It was used to show info at the bottom of certain pages where you ticked a box when editing a page. The info is no longer showing at the front end and I was hoping someone could have a look at my code please.
    The following is in the footer.php file of the child theme:

    <?php do_action( 'avada_after_main_content' ); ?>
    				</div>  <!-- fusion-row -->
    					$book_online =  get_post_meta($post->ID, 'book_online', true);//echo'ssssssssss'.var_dump($book_online);
    						if(function_exists( 'iinclude_page' ) AND $book_online){
    							echo '<div class="kkFix" style="margin-left: -30px; margin-right: -30px; margin-bottom: 0px;">';
    					$opening_hours =  get_post_meta($post->ID, 'opening_hours', true);//echo'oooooooo'.var_dump($opening_hours);
    						if(function_exists( 'iinclude_page' ) AND $opening_hours){
    							echo '<div class="" style="margin-left: -30px; margin-right: -30px; margin-bottom: 0px;">';

    So I am trying to show the info which is in page id’s 11793 and 11734 on certain other pages and have ensured that the boxes are checked in the back end (page edit section) on those other pages. The info is not showing on any pages on which the boxes are checked. Can anyone help please? TIA.

  • Hey,
    If opening_hours and book_online are acf fields, then you can use

    $book_online = get_field('book_online', $post->ID);
    if(function_exists( 'iinclude_page' ) && $book_online)
    //code here

    You also need to make sure that the $post and the function iinclude_page is available.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.