Forums

[resolved] Hide post titles selectively (3 posts)

  1. mitheithel
    Member
    Posted 6 months ago #

    Hello,
    while blogging on my personal blog I don't always use post titles. Thus, I'd like to add to my theme a structure like this (pseudocode):

    if
    post_title != "no title"
    than
    display post_title

    Anyone can help?
    Thank you

    PS: I know I could just add a custom field (as suggested here), but I've just imported hundreds of post from a previous blog and the whole operation would be a bit tedious.

  2. esmi
    Theme Diva & Forum Moderator
    Posted 6 months ago #

    <?php if( get_the_title() ) the_title();?>

  3. mitheithel
    Member
    Posted 6 months ago #

    Modified to:
    <?php if( get_the_title() != "no title" ) the_title(); ?>
    And works like a charm! Thank you!

Reply

You must log in to post.

About this Topic