WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Subtitle before title... (8 posts)

  1. jmaraujo
    Member
    Posted 6 years ago #

    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".

  2. Ivovic
    Member
    Posted 6 years ago #

    supertitle? heh.

    regardless of what it's called, you can do it with custom fields
    http://codex.wordpress.org/Using_Custom_Fields

  3. jmaraujo
    Member
    Posted 6 years ago #

    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.

  4. Ivovic
    Member
    Posted 6 years ago #

    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.

  5. jmaraujo
    Member
    Posted 6 years ago #

    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?

  6. Ivovic
    Member
    Posted 6 years ago #

    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.

  7. jmaraujo
    Member
    Posted 6 years ago #

    Yessss! Thank you, Ivovic!!!

    Now it's working as I wanted.

    Thank you so much.

  8. oberazzi
    Member
    Posted 6 years ago #

    Thanks for the code. Very useful.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags