• Resolved primeratoma

    (@primeratoma)


    Hi team!

    Is it possible to add a custom field under the title of the post?
    I mean, I have a custom field named “NOTA” and I would like to appear under the title in the “related posts”.
    Is it possible?

    Thank you and best regards.

    The page I need help with: [log in to see the link]

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Support Michael Nelson

    (@mnelson4)

    Hi @primeratoma, good question.

    Yes it’s possible, but it takes some HTML and coding know-how.

    You’ll want to create a custom template, and use get_post_meta('NOTA') somewhere in it to show that custom field.

    Does that make sense?

    Thread Starter primeratoma

    (@primeratoma)

    Hi Michael,
    Thank you very much for yout answer.
    I have the custom field named ‘NOTA’, and it shows in every post.
    But my doubt is the place that I have to put this “call” to appear in the related posts below.
    I guess next to the title, but I’ve checked the files of the plugin and I didn’t find it.

    Best regards.

    Plugin Author YARPP

    (@jeffparker)

    Hi @primeratoma

    You’d need to create a custom YARPP template, in which you’d add get_post_meta('NOTA').

    Instructions:

    https://www.ads-software.com/plugins/yet-another-related-posts-plugin/#how%20can%20i%20use%20the%20custom%20template%20feature%3F

    Under Yarpp -> Themes -> Select “Custom”. This will copy over YARPP custom templates to your active theme directory. At which point you can edit the custom Yarpp theme files.

    YARPP’s custom templates feature allows you to uber-customize the related posts display using the same coding conventions and Template Tags as in WordPress themes. Custom templates must be in your active theme’s main directory in order to be recognized by YARPP. If your theme did not ship with YARPP templates, move the files in the yarpp-templates directory which ships with YARPP into your active theme’s main directory. Be sure to move the files (which must be named yarpp-template-….php) to your theme, not the entire directory.

    Thread Starter primeratoma

    (@primeratoma)

    Hello again,

    Thank you so much for the help, I think I’m in the right way, but now I’ve got a new problem. I get the “NOTA” under the title of every thumbnail, but the thumbnails appears in column, not horizontal.

    I’ve made new css for some elements, and I think that I have to change some class in the class “yarpp-related-shortcode” to get all the elements in horizontal. I’ve tried all the variables for “display” with no success.

    Even I tried to add one line to the created templates of thumbnails (line <?php echo get_post_meta($post->ID,’NOTA’,true); ?> ) with no success.

    Maybe you could help me in this issue, please?

    Thank you and best regards.

    Thread Starter primeratoma

    (@primeratoma)

    Any idea?

    Thank you very much.

    Thread Starter primeratoma

    (@primeratoma)

    Hello there?

    Plugin Support Michael Nelson

    (@mnelson4)

    Hi @primeratoma, yes I see you’re making progress!
    I’m afraid you’ve now ventured into the world of HTML and CSS that’s probably a bit beyond what we’d normally support. Having said that, I’d suggest you wrap each related item in a div, and give that wrapping div display:inline-block. Or you could even try your hand at using flexbox. If you have more questions about using HTML and CSS to get things to display inline, I’d suggest doing a bit more background reading on HTML element display and maybe ask about it on Stack Overflow.

    Good luck! I’m going to mark this as complete for now.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Add custom field under the title’ is closed to new replies.