Home › Forums › Pro Support › Change order of elements
Tagged: ordering
- This topic has 7 replies, 2 voices, and was last updated 4 years, 11 months ago by
Tom.
-
AuthorPosts
-
October 19, 2018 at 7:06 pm #6246
Janek
ParticipantGood morning,
Just wondering if there’s a way to simply put the post title (.wp-show-posts-entry-header) below the content (.wp-show-posts-entry-content).
Would be happy to implement this with PHP or CSS whichever is best.
Thanks in advance for any help you can lend.
October 20, 2018 at 7:42 pm #6254Janek
ParticipantAlternatively if I could get a list of the filters I can output a custom field after the entry-content myself.
October 20, 2018 at 7:57 pm #6255Janek
ParticipantSo I found in one of my old support threads here that I can use wpsp_after_content as a filter so with the following I should be able to output a custom field after the content however I’m finding it doesnt want to work. Something to do with the filter since if I change it to wpsp_before_content it outputs the custom field above fine. Any thoughts?
add_action( 'wpsp_after_content', 'tu_add_custom_meta_testimonial' ); function tu_add_custom_meta_testimonial() { $meta = get_post_meta( get_the_ID(), 'testimonial_source', true ); if ( isset( $meta ) && '' !== $meta ) { echo '<div class="testimonial-source">' . $meta . '</div>'; } }
October 20, 2018 at 9:53 pm #6256Tom
KeymasterHave you tried something like this?:
add_action( 'wpsp_after_content', function() { the_title(); } );
Let me know 🙂
October 20, 2018 at 11:46 pm #6257Janek
ParticipantHey Tom,
That only appears to display the page title below the content instead of the post title of the WPSP list. It also targets all WPSP lists.
I’d prefer to implement a custom field as shown above, this way I can ensure it only works on the WPSP that have posts that use the custom field. But as mentioned for some stupid reason it doesnt work with ‘wpsp_after_content’ but it does with ‘wpsp_before_content’.
October 21, 2018 at 6:32 pm #6259Tom
KeymasterThat’s really strange. Those hooks are very close to each other within the code – they should work the exact same.
What if you do this?:
add_action( 'wpsp_after_content', 'tu_add_custom_meta_testimonial' ); function tu_add_custom_meta_testimonial() { global $post; $meta = get_post_meta( $post->ID, 'testimonial_source', true ); if ( isset( $meta ) && '' !== $meta ) { echo '<div class="testimonial-source">' . $meta . '</div>'; } }
October 22, 2018 at 4:12 am #6267Janek
ParticipantOk, I’m really shitty now, cause I’ve wasted your time. I did the old disable all plugins except WP Show Posts and Advanced Custom Fields and it seems that the problem was the Codeit Glossary plugin which somehow is preventing the custom field from appearing. Makes no sense but there you go! I’ll work at fixing this issue by troubleshooting the Glossary plugin with their dev. There plugin is great in theory but it has so many quirks.
October 22, 2018 at 8:56 pm #6281Tom
KeymasterGlad you figured it out 🙂
-
AuthorPosts
- You must be logged in to reply to this topic.