• Resolved jamieharrop

    (@jamieharrop)


    Hello,

    I’m using a modified version of the “Classic” WordPress theme. All the file names are the same as what they are in the default classic theme, but I’ve modified the XHTML/CSS.

    I’d like to remove the blog name from the <title> of my sub pages, but unfortunately I can only seem to create one template for both the home page and sub pages.

    I also have an item on all pages that is contained within the template (an image), that I would only like to see appear on the home page, so again I need to apply a seperate template to the home page compared to the sub page template.

    How would I go about doing this?

    Thanks in advance.

    Jamie

Viewing 9 replies - 1 through 9 (of 9 total)
  • Can we take a look at what you are talking about?

    Thread Starter jamieharrop

    (@jamieharrop)

    Sure.

    https://www.jamieharrop.com

    See the “This is Jamie Harrop Dot Com” text. This is a part of the template so it appears on each post and page (because each post and page just uses one single template). I want to this to appear only on the home page, so I need to find a way for the home page to be created using a different template than that of the single posts and pages.

    Likewise, I want the <title> to be in a different format on the home page. For example, on the homepage I just want the <title> to have the blog name, but on single posts and pages, I just want the post or page name rather than “Blog Name – Post Name” as it is now.

    Hope that helps explain what I’m looking to do.

    Jamie

    I’m sure you could do that with conditional tags, or maybe by using custom fields? I’m going to goof around with conditionals (I just started learning about them) and I’ll give you a yell if I figure out a way.

    Did you split your template up into different files, i.e. index, sidebar, header, footer – or use it as is, just one file?

    I like your site, by the way. Bookmarked and subscribed – I’m about to make coffee and settle down for a nice read!

    Thread Starter jamieharrop

    (@jamieharrop)

    Hey RoseCitySister,

    The template is split in to files as you say. It’s laid out exactly the same as the “classic” theme that comes bundled with WordPress.

    Thanks for the kind comments about the site. ??

    I appreciate any suggestions you may be able to send my way.

    Thanks!

    Jamie

    If you are using single.php for your posts then you should be able to delete that part from that template page.

    I use single.php for single posts and it doesn’t have some of the extra junk that shows up on my home page.

    That might help if it’s only showing up on the single post pages. If it’s also showing up on Archives & Category pages, you should be able to delete it as well.

    Thread Starter jamieharrop

    (@jamieharrop)

    Hi Kahaku,

    I’m not using single.php for my posts. That’s exactly what I need to do, but I’m not sure how to do so.

    I assume if I add a single.php file in to the template, it won’t automatically start reading from that template for single posts. How would I go about making the blog read from single.php for single posts?

    Thanks!

    Jamie

    Here’s my single.php.

    It might not display properly for you because of CSS compatibility issues, but it’ll give you a frame work.

    https://paste-it.net/public/u4d74ea/

    Thread Starter jamieharrop

    (@jamieharrop)

    Well would you look at that. When you add a single.php file to the template, WP automagically looks at that file for single posts.

    I completely wrote that solution off because I didn’t think WP would automatically look for that file for single posts (I assumed, like most PHP scripts, you would have to somehow tell it to look there).

    But it seems WP has surprised me yet again. ??

    Thanks Kohaku! I haven’t implemented it on my blog mentioned above, but I just did it on a blog for one of my clients and it works great.

    Glad it worked!!

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Seperate Template for Home Page’ is closed to new replies.