juliape
Forum Replies Created
-
Forum: Plugins
In reply to: [Custom Post Carousels with Owl] Display custom fields as contentHi, what i have so far is this:
add_action( 'dd-carousel-after-content' , 'my_custom_carousel_header' , 10, 1); function my_custom_carousel_header($id){ if ($id == 11253) { // your carousel ID - numeric global $post; echo '<p>'.get_field('resumen', $post->ID).'</p>'; } }
what i want to do is add more of my custom fields, but i’m having some issues.
Also, i would need to set whatever i manage to add in this “new meta” in all my other carosusels, in which i’ve tried but failed with the following:
add_action( 'dd-carousel-after-content' , 'my_custom_carousel_header' , 10, 1); function my_custom_carousel_header($id){ if (in_array($_GET['id'], array(11253, 10959))) { global $post; echo '<p>'.get_field('resumen', $post->ID).'<p>'; } }
Forum: Plugins
In reply to: [Custom Post Carousels with Owl] Display custom fields as contentThank you for your quick response, and I am sorry that I cannot communicate my issue clearly.
I’ve coppied the following code from this answeradd_action( 'dd-carousel-after-content' , 'my_custom_carousel_header' , 10, 1); function my_custom_carousel_header($id){ if ($id == 2267) { // your carousel ID - numeric global $post; echo '<a href="'.get_permalink($post->ID).'">'.get_the_title($post->ID).'</a><br>'; $terms = get_the_terms($post->ID, 'product_cat'); // use your custom taxonomy $term_list = array(); foreach ($terms as $term){ $term_list[] = $term->name; } echo implode(', ', $term_list); } }
This indeed showed the title of my post, so i thought that simply editing the code below would show the info i need, but can’t seem to find the way.
I understand if this query is not relevant, sorry for any inconvenienceForum: Plugins
In reply to: [Custom Post Carousels with Owl] Display custom fields as contentWhat i want to do is, for example, replace the default “date” or “author” with my custom fields “genre”, “format”, etc. In my theme i know how to call that info with get_field, but fail to write that correcly in the hooks that i’ve found here