Support

Account

Home Forums Front-end Issues Advanced Custom Field gives error on only one category and works fine on other c

Unread

Advanced Custom Field gives error on only one category and works fine on other c

  • The backend of my WordPress post page has a text field input that I made using Advanced Custom Fields. I input a page ID and the post page redirects to that page. I have about 15 landing pages that act as categories and each landing page has a category associated to it with quite a number of posts in each landing page.

    The text field (page_id) works fine on all posts except this one category.

    `<a href=”<?php echo esc_url( get_page_link( $page_id ) ); ?>”>
    <?php if(get_secondary_title($page_id))
    {
    echo get_secondary_title($page_id);
    }
    else
    {
    the_title($page_id);
    }
    ?>
    </a>`

    I am using a plugin to pull a secondary title of the post and that’s the extra code that you see here.

    The URL is redirecting to the correct page. But the title is coming in this format “123Current Page Title”. Where 123 is the page ID of the title I want and current page title is the post I am on right now, not the one I want.

Viewing 1 post (of 1 total)

The topic ‘Advanced Custom Field gives error on only one category and works fine on other c’ is closed to new replies.