• How do I enable post title visibility on all posts in the WPFolio theme, not just on blog posts?

    I would like single posts in all categories to have the title visible. I’ve tried a workaround by adding a h2 title to the beginning of the post, but that means the title shows up twice on the homepage and the archive.

    The easiest (though it breaks upgrade) would probably be to modify this line in single.php to always return true:

    <?php /* If this is in the blog category */ if(in_category(array('news','latest', 'updates', 'blog', 'notable'))):	 ?>

    Any advise on what the best path would be would be highly appreciated.
    Thanks

Viewing 7 replies - 1 through 7 (of 7 total)
  • Use a child theme! You can make a single.php in the child theme folder and make your changes there (won’t be updated on updates though).

    In the above line of code, you could add the names of the categories you want to use this format to the array. But know that the single blog post template includes the sidebar, date, and other post info. If you don’t want those, you’ll have to make another condition – else if (in_category('my_category')): or something similar.

    Also, post titles do appear on every page. In the “news” category, they appear on the top of the post. In other categories they appear at the bottom of the post so your image or video is seen first.

    Thread Starter raakvlak

    (@raakvlak)

    @notlaura; re the use of child-themes: this is what i meant with that it “breaks upgrade” – otherwise, everything I do is in a childtheme.

    Good point about the child theme. Will have to look for another way around.

    @slambert: I know the title is at the bottom, but I’d like to have it at the top as well. As for the image or video being the first thing you see, as it is, the videos for any of the visual works already run off the bottom of the screen and you have to scroll down to see all of it. (at least on my MacBook Then there’s this tiny thing that not all of my work is visual, and I don’t want that other work to just have to go into the blog. But that is a different matter.

    I’ll see what I can do with hacking the title back into any single posts for the other categories.

    You can meanwhile check out how far I got at https://raakvlak.net

    Thanks for the replies.

    I have this same requirement – see https://chrisdrury.evodev.net/land-water-and-language/ looks pretty wierd without a title? Now see the post in the news/blog with title https://chrisdrury.evodev.net/news/ which is how I need it to look.

    Trouble is I know nothing about php so I don’t know how to follow the suggestions above or even what it means when you say a child theme won’t get updated.

    Is this the only way to have the title option? Or is it possible to provide more step-by-step instructions?

    Like Steve said above, the title appears at the bottom of each post in a small line of meta info including the title, categories, date, and comments. This is a design choice – generally posts consist of large images and we thought it best to make the title subtle.

    But if you’d like it bigger, do these things:

    1. Create a child theme. Actually, it looks like you are already using a child theme so good job. Anyone else who needs to create one can reference the Codex..

    2. Duplicate single.php from the original WPFolio and drag it into into your child theme folder.

    3. To add a title to every post, copy and paste this around line 69, after <div class="entry..."> and before <?php the_content ?>:

    <h2 class="post-title">
        <a title="'<?php the_title_attribute(); ?>', posted on <?php the_time('F jS, Y') ?>" href="<?php the_permalink() ?>"><?php the_title(''); ?></a>
    </h2>

    4. Refresh the page and voila (hopefully).

    Or, you can just copy and paste all of this into single.php in your child theme.

    Thanks notlaura – works a treat!

    Can I ask a couple more questions as you’ve been kind enough to look at the site?

    For example https://chrisdrury.evodev.net/ecoart/

    How can I make the margin of the body content line up with the header (i.e. EcoArt lines with Chris)?
    Is it possible to display the image description text? The artist has comments about each picture which are too long to go in the caption field. Can the descriptive text be displayed under the big images?

    Thanks so much for your help

    Ian

    Ian – can you send me this in an email? Just to keep this thread on topic for anyone else who needs it. Send to: [email protected]

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Enable Post Titles on All Posts in WPFolio’ is closed to new replies.