[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: 

This topic contains 33 replies, has 7 voices, and was last updated by  Tom 2 weeks ago.

Viewing 4 posts - 31 through 34 (of 34 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 2 weeks, 2 days 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?

Viewing 4 posts - 31 through 34 (of 34 total)

You must be logged in to reply to this topic.