• Resolved jmaraujo

    (@jmaraujo)


    Hi, I’m running a blog with news of my local community.

    I want to add a subtitle* before each post title… Something like:
    // Subtitle
    // Title
    // {Main post text}

    For example:

    The first game will be on thursday…
    Celtics-Lakers meet again in the NBA finals

    In the example, “Celtics-Lakers meet again in the NBA finals” is the post title. And “The first game will be on thursday…” is the subtitle I will like to add on my posts.

    Is there any way I can add a subtitle like the example? I have googled but haven’t found anything conclusive yet.

    Thanks in advance.
    Bye,
    Juan M.

    (*) I think it’s not really a subtitle, but I don’t know how it’s called in english. I think in spanish it’s called “colgado” or “cintillo”.

Viewing 7 replies - 1 through 7 (of 7 total)
  • supertitle? heh.

    regardless of what it’s called, you can do it with custom fields
    https://codex.www.ads-software.com/Using_Custom_Fields

    Thread Starter jmaraujo

    (@jmaraujo)

    Thanks, Ivovic!!!

    I was able to add the custom field, but it shows like:

    >> Key: Value

    How can I make only the value to show on the post? Also I would like to hide the “>>”.

    Thanks.

    remove the key part?

    I think you’re taking the code you saw on that page too literally… you have choices. Look at the other examples available there, and feel free to edit it a little.

    Thread Starter jmaraujo

    (@jmaraujo)

    Yes, I think so too… But the problem is that I don’t have much experience with php/wordpress/mysql…

    If is not too much trouble, can you give an example on how to modify my template?

    Well, you’ve modified your template already, so try just using this, instead of what you have now:

    <?php echo get_post_meta($post->ID, 'yourKeyNameHere', true); ?>

    that will just pull the value.

    Thread Starter jmaraujo

    (@jmaraujo)

    Yessss! Thank you, Ivovic!!!

    Now it’s working as I wanted.

    Thank you so much.

    Thanks for the code. Very useful.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Subtitle before title…’ is closed to new replies.