Home › Forums › Pro Support › show data below post title
Tagged: data, meta, position, post title
- This topic has 12 replies, 2 voices, and was last updated 3 years, 1 month ago by
Davide.
-
AuthorPosts
-
July 28, 2020 at 2:22 pm #17747
Davide
ParticipantHi, I’ve a question, is it possible to put the post-data below the post title?
thanks to this thread https://wpshowposts.com/support/topic/show-terms-above-post-title/ I already moved the category above the title, now I’d like to the data from under the post excerpt to just below the title.thank you!
DaveJuly 28, 2020 at 3:41 pm #17757Tom
KeymasterHi there,
You should be able to set the meta location in the settings: https://docs.wpshowposts.com/article/meta-overview/
Let me know 🙂
July 29, 2020 at 4:54 am #17774Davide
ParticipantHi Tom, thank you.
But like I wrote, I’m already using this method https://wpshowposts.com/support/topic/show-terms-above-post-title/ to show the category above the post title, if I select the post date location as “below title” it’ll be shown on top like the category.What I’d like to achieve is
category
post title
dataany hint? (or is there any “advanced” documentation?
thank you!
DavideJuly 29, 2020 at 2:23 pm #17792Tom
KeymasterIt may be better to manually place the categories before the title.
Let’s try:
1. Remove the code you added to move the categories.
2. Use the options I pointed to in the previous post.
3. Manually add the categories before the title:add_action( 'wpsp_before_title', function( $settings ) { printf( '<span class="wp-show-posts-terms wp-show-posts-meta">%1$s</span>', get_the_term_list( get_the_ID(), $settings[ 'taxonomy' ], '', apply_filters( 'wpsp_term_separator', ', ' ) ) ); } );
July 31, 2020 at 7:53 am #17844Davide
ParticipantHi Tom, thank you.
Should I change something in the piece of code you posted? Because if I keep it like this, it’s not working.thank you!
DavideJuly 31, 2020 at 8:02 pm #17856Tom
KeymasterYou shouldn’t need to change anything – is anything appearing before your title?
August 1, 2020 at 9:54 am #17861Davide
Participantnope,
it shows:post title
post date | categoriesDavide
August 3, 2020 at 12:52 pm #17897Tom
KeymasterCan you try the updated code?: https://wpshowposts.com/support/topic/show-data-below-post-title/#post-17792
August 4, 2020 at 11:19 am #17930Davide
ParticipantHi Tom, thank you
almost there I guess 😉Now the category are shown on top AND after the post-date
category
post title
post date | category
excerptAugust 4, 2020 at 1:28 pm #17939Tom
KeymasterCool, so now disable the terms inside the list so they don’t show up, and update the function once more: https://wpshowposts.com/support/topic/show-data-below-post-title/#post-17792
August 5, 2020 at 2:07 pm #17973Davide
Participantperfect, thanks!
Is there a way to assign this to only one specific list?thank you
DavideAugust 6, 2020 at 2:45 pm #18009Tom
KeymasterAbsolutely, you can do this:
add_action( 'wpsp_before_title', function( $settings ) { if ( 123 === $settings['list_id'] ) { printf( '<span class="wp-show-posts-terms wp-show-posts-meta">%1$s</span>', get_the_term_list( get_the_ID(), $settings[ 'taxonomy' ], '', apply_filters( 'wpsp_term_separator', ', ' ) ) ); } } );
Just update
123
to the list ID.August 7, 2020 at 10:00 am #18032Davide
ParticipantThank you!
Davide -
AuthorPosts
- You must be logged in to reply to this topic.