[Resolved] ACF fields in a blog category archive post output

Please login to receive premium support.

Support for the free plugin can be found here.

Home Forums Pro Support ACF fields in a blog category archive post output

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #30800
    Ushan
    Participant

    Hi,
    I have a team page created with Blog posts of the category “Team” (ID 6).
    This category have 2 acf fields – team-title and team-linkedin-url.

    How can I show these fields on the WSP created archive page?

    TIA

    • This topic was modified 1 week, 4 days ago by Ushan.
    #30815
    elvin
    Moderator

    Hi Ushan,

    WPSP doesn’t control the other parts of the archive page. It only works with the post list it displays. The rest of the things you see within the page are from either the theme or another plugin.

    This means you’ll have to use your theme’s hooks if you want to hook in ACF field values to the part of the archive page you’ve placed your WPSP list on.

    IF you want to hook in ACF field values on WPSP post items, here are the hooks you can use – https://wpshowposts.com/support/topic/bbpress-metadata-and-dates-in-wpshowposts/#post-28854

    #30817
    Ushan
    Participant

    As per Tom’s answer somewhere else (sorry!) – this got it working.

    add_action( ‘wpsp_after_title’, function( $settings ) {
    if ( 321 === $settings[‘list_id’] ) {
    $meta = get_post_meta( get_the_ID(), ‘field-name’, true );

    if ( $meta ) {
    echo $meta;
    }

    }
    } );

    Where 321 is the Show Posts list id. I was getting nowhere because I was putting the category ID in. 😀

    #30867
    elvin
    Moderator

    ah, that makes sense! lol.

    Yeah, you have to add in the ID of the WPSP list. Glad you got it figured out. nice catch! 😀

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.