Displaying Specific Page Titles (Loop) (1 post)

  1. timemachines
    Posted 3 years ago #

    I am trying to display specific page titles. I have this working for the most part, but I have several posts that are ARTICLES and a page that displays ALL of the ARTICLE Snippets (like a blog post - though that seems obvious).

    The problem I face is that I want my ARTICLE ARCHIVE page to display its own title when the viewer lands on it... and each individual article page to display the its own title.

    Currently - the ARTICLE ARCHIVE page displays the Title of the first or featured article.

    I am using the following code to get the title. I found it in the forums today - and it truncates the lengthier names of Page Titles - which is what I wanted. And though it works well - the archived articles page displays the first posts title instead of its own.

    <?php if (strlen($post->post_title) > 40) {
    echo substr(the_title($before = '', $after = '', FALSE), 0, 30) . '...'; } else { the_title(); } ?>

    Any thoughts? Tweaks?

    I tried making alterations, but I am not so PHP smart..


Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.