Black Friday sale! Get 25% off WPSP Pro! Discount automatically applied at checkout.

[Resolved] Custom Fields

Please login to receive premium support.

Support for the free plugin can be found here.

Home Forums Pro Support Custom Fields

Tagged: 

Viewing 14 posts - 31 through 44 (of 44 total)
  • Author
    Posts
  • #13247
    Cris
    Participant

    Perfect!! I have learned a lot with this. Thanks a lot Tom!!!

    I have proven that without ‘ . $term->slug . ‘ it also works.

    #13272
    Tom
    Keymaster

    Awesome! Glad I could help 🙂

    #13306
    sparkle
    Participant

    hi tom, is there a step by step somewhere for getting custom field content to display in a list (or ultimately in a carousel)? i have three custom fields in my cpt (cptui/acfpro) and i put this into my functions file, but am unsure how to ‘just hook them’ to get them into my list and ultimately to display as the carousel. [edited for clarity and to add when i put the below code in my functions file, i get a database error, too.]

     
    add_action( 'wpsp_before_content','wpsp_add_custom_meta' );
    function wpsp_add_custom_meta()
    {
        $meta = get_post_meta( get_the_ID(), 'st-headline', true );
        if ( isset( $meta ) && '' !== $meta )
            echo $meta;
    }
    
    add_action( 'wpsp_before_content','wpsp_add_custom_meta' );
    function wpsp_add_custom_meta()
    {
        $meta = get_post_meta( get_the_ID(), 'short_testimonial', true );
        if ( isset( $meta ) && '' !== $meta )
            echo $meta;
    }
    
    add_action( 'wpsp_before_content','wpsp_add_custom_meta' );
    function wpsp_add_custom_meta()
    {
        $meta = get_post_meta( get_the_ID(), 'st-attribution', true );
        if ( isset( $meta ) && '' !== $meta )
            echo $meta;
    }
    • This reply was modified 9 months, 3 weeks ago by sparkle.
    #13346
    Tom
    Keymaster

    That code looks like it should work, although you could wrap them all into one function.

    What’s the error you’re getting?

    #17796
    Austin
    Participant

    Where do I put this PHP?

    #17804
    Austin
    Participant

    I tried adding it as a hook element but I must be doing it wrong.

    • This reply was modified 4 months ago by Austin. Reason: duplicate
    #17825
    Tom
    Keymaster

    You should use one of these methods: https://docs.wpshowposts.com/article/adding-php/

    #19825
    heinrich
    Participant

    hi tom, are there any thoughts to support acf in a more visible way (like toolset)?

    #19927
    Tom
    Keymaster

    As of right now our primary focus is to build a WPSP block for the block editor, so the current shortcode implementation likely won’t get much more innovation.

    #19976
    heinrich
    Participant

    tks for info tom, but the question is the same. when you are at the blocks development (super excited about :-)), are there thoughts to support acf directly (as toolset)? or do you stay by the exisiting approach to handle this with individual code?

    #20042
    Tom
    Keymaster

    At the very least there will be template tags that will allow you to use custom fields. I’m certainly not against further ACF/Toolset support as well, would need to look into that.

    #20163
    heinrich
    Participant

    tks for info…

    #22770
    Adam
    Participant

    Hello Tom,

    I followed all of the instructions to display custom fields on my posts and it works great! I was wondering if you have a solution for displaying the custom fields only on hover? I.e. the default state of the post/card is just an image and then when you hover – all of the custom fields are displayed similar to Overlay Style #1 or #2 here – https://demos.wpshowposts.com/cards/

    Thanks – Love all of the support you provide for GP and these plugins.

    #22789
    elvin
    Participant

    Hi Adam,

    I believe you have the same question here? Please check my answer. Thank you.
    https://generatepress.com/forums/topic/more-meta-content-in-wp-show-posts/#post-1533994

Viewing 14 posts - 31 through 44 (of 44 total)
  • You must be logged in to reply to this topic.