Support

Account

Home Forums General Issues Using get_post_meta On Posts Page

Solved

Using get_post_meta On Posts Page

  • Hi,

    I’m trying to use get_post_meta as much as possible to reduce database queries and also so I can disable ACF on the front end.

    I’m struggling to get the fields to work on the posts page.

    How can I change this:

    $page_title = get_field( 'page_title', get_option( 'page_for_posts' ) );

    To get_post_meta

    Thanks in advance.

    Paul

  • No worries, I’ve found a solution.

    $page_id = get_option( 'page_for_posts' );
    
    $page_title = get_post_meta( $page_id, 'page_title', true );

    Thanks

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

The topic ‘Using get_post_meta On Posts Page’ is closed to new replies.