We're merging with GenerateBlocks! Learn more here.

[Support request] show data below post title

Please login to receive premium support.

Support for the free plugin can be found here.

Home Forums Pro Support show data below post title

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #17747
    Davide
    Participant

    Hi, 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!
    Dave

    #17757
    Tom
    Keymaster

    Hi there,

    You should be able to set the meta location in the settings: https://docs.wpshowposts.com/article/meta-overview/

    Let me know 🙂

    #17774
    Davide
    Participant

    Hi 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
    data

    any hint? (or is there any “advanced” documentation?
    thank you!
    Davide

    #17792
    Tom
    Keymaster

    It 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', ', ' ) )
        );
    } );
    #17844
    Davide
    Participant

    Hi 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!
    Davide

    #17856
    Tom
    Keymaster

    You shouldn’t need to change anything – is anything appearing before your title?

    #17861
    Davide
    Participant

    nope,
    it shows:

    post title
    post date | categories

    Davide

    #17897
    Tom
    Keymaster
    #17930
    Davide
    Participant

    Hi 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
    excerpt

    #17939
    Tom
    Keymaster

    Cool, 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

    #17973
    Davide
    Participant

    perfect, thanks!
    Is there a way to assign this to only one specific list?

    thank you
    Davide

    #18009
    Tom
    Keymaster

    Absolutely, 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.

    #18032
    Davide
    Participant

    Thank you!
    Davide

Viewing 13 posts - 1 through 13 (of 13 total)
  • You must be logged in to reply to this topic.