WordPress.org

Ready to get started?Download WordPress

Forums

Show post title only on individual page (11 posts)

  1. rayne
    Member
    Posted 10 years ago #

    How do I display the post title only on the individual post page?

  2. OperaManiac
    Member
    Posted 10 years ago #

    off the topic. why would u want to do that?
    a newspaper frontpage with just the news and no headlines!

  3. davidchait
    Member
    Posted 10 years ago #

    huh? I'm not sure what you are looking for, but in index.php (and I believe there's one for individual posts, though I use index for single or multi post pages on http://www.chait.net) you'll see a set of calls iterating over the posts for the page. It begins with "foreach ($posts as $post)" or something like that. You should then see a php call to the_title(), followed by one to the_content(). Obviously, if you took out the call to the_content (and anything else you want removed), you'll just get the post title output.
    =d

  4. rayne
    Member
    Posted 10 years ago #

    Sorry. I don't think my question made sense. On my index page I don't want to display the post titles. Just their date and content. If you click the permalink to go to that post's individual page, there is where the title of the post will show. Does that make more sense?

  5. Anonymous
    Unregistered
    Posted 10 years ago #

    Yes, though it may not always work as desired... ;)
    In index.php, you want to basically play with the call to the_title(). inside the php section, change
    the_title();
    to something like
    if ($p!="") the_title();
    I think that'll basically work. The if ($p!="") is using detection of going to a post-page by the $p variable. allusion would be able to say all the cases where that might not work. For instance, it won't work if you go to a daily page on the calendar that "just so happens" to have only a single post... that's still NOT [that] post's page.
    =d

  6. davidchait
    Member
    Posted 10 years ago #

    And yes, that was me. darn it. must have forgotten to login at work...
    Let me know if that doesn't work, or is confusing.
    =d

  7. james_anderson
    Member
    Posted 9 years ago #

    I wanted to show the post only in the category where they were posted... not on all top categories above that categories... tried several things... but no luck... pls help.

  8. JimClark
    Member
    Posted 9 years ago #

    I used a variation on the idea that David posted above, to limit the display to only show the "titles", "filed under stuff", and the "comment info line". This definitely improves the readability of a parent category, and maybe you can extend this for other php variables.

    Where David mentions the test for the lack of a post value ($p) to trigger the display of a title, I used the same type of test to not display $the_content variable. If you click on the title you get the whole post. Find this DIV in the index.php file . . .

    <div class="storycontent">
    <?php the_content(); ?>
    </div>

    replace it with this . . .

    <div class="storycontent">
    <?php if($p != '') {the_content();} ?>
    </div>

    This will prevent the content of a post from displaying until you actually click on a post title to read it further. Its not exactly what you want, but its close.

  9. GKDantas
    Member
    Posted 8 years ago #

    Hi JimClark

    I tried your little hack and doenst work for me... I am using the Blase theme with some modifications... can you help with more details about this change?

  10. ravi1
    Member
    Posted 7 years ago #

    I was also looking for this info

  11. srinbar
    Blocked
    Posted 7 years ago #

    I am on the same bench with ravi1 . Means looking for this important info.

    [sig moderated]

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.