Home › Forums › Pro Support › Custom Fields
Tagged: acf
- This topic has 43 replies, 11 voices, and was last updated 2 years, 2 months ago by
elvin.
-
AuthorPosts
-
February 7, 2020 at 1:34 am #13247
Cris
ParticipantPerfect!! I have learned a lot with this. Thanks a lot Tom!!!
I have proven that without ‘ . $term->slug . ‘ it also works.
February 7, 2020 at 6:53 pm #13272Tom
KeymasterAwesome! Glad I could help 🙂
February 10, 2020 at 5:40 am #13306sparkle
Participanthi 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; }
February 11, 2020 at 5:13 pm #13346Tom
KeymasterThat code looks like it should work, although you could wrap them all into one function.
What’s the error you’re getting?
July 29, 2020 at 3:40 pm #17796Austin
ParticipantWhere do I put this PHP?
July 29, 2020 at 3:49 pm #17804Austin
ParticipantI tried adding it as a hook element but I must be doing it wrong.
July 30, 2020 at 1:11 pm #17825Tom
KeymasterYou should use one of these methods: https://docs.wpshowposts.com/article/adding-php/
September 23, 2020 at 11:56 pm #19825heinrich
Participanthi tom, are there any thoughts to support acf in a more visible way (like toolset)?
September 24, 2020 at 1:35 pm #19927Tom
KeymasterAs 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.
September 24, 2020 at 11:45 pm #19976heinrich
Participanttks 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?
September 25, 2020 at 2:12 pm #20042Tom
KeymasterAt 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.
September 27, 2020 at 10:36 pm #20163heinrich
Participanttks for info…
November 17, 2020 at 7:54 am #22770Adam
ParticipantHello 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.
November 17, 2020 at 1:56 pm #22789elvin
ModeratorHi 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 -
AuthorPosts
- You must be logged in to reply to this topic.