• Resolved leatherbarrow

    (@leatherbarrow)


    Hi guys,

    I am trying to style my posts page the same as every other page on my site. I understand that when selecting from the drop-down menu in reading settings the page I select ignores the custom template selected in my page settings. What I find frustrating is that MANY people have asked this question and received rude and short answers from people.

    Can someone please put their ego aside and answer the following question:

    Is it possible to have my posts page use a custom template?
    If so , can you please explain how.
    If not, can you please not post some smart arse answer that makes you feel really good about yourself and attempts to make me feel bad about myself.

    Thanks guys,
    Adam.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hey Adam,

    It sounds like what you want to do is absolutely possible — I just have a couple questions to clarify your situation… First, are you using a particular theme or in the process of building your own? Second, are you talking about your post listing pages (showing multiple posts in a list) or the page used to display an individual post? These are handled by different files, and your answers will help get us in the right direction.

    Also, the Theme Development Codex is a good place to go for quick reference when you’re trying to find something in your theme files. I find it helpful when modifying a new theme.

    Cheers,
    Doug

    Is it possible to have my posts page use a custom template?

    the ‘posts page’ uses index.php or home.php;

    http://codex.ww.wp.xz.cn/Creating_a_Static_Front_Page
    http://codex.ww.wp.xz.cn/Template_Hierarchy#Home_Page_display

    i.e. you can create home.php and customize it in any way.

    If not, can you please not post some smart arse answer that makes you feel really good about yourself and attempts to make me feel bad about myself.

    hopefully the above reply fullfills your requirement;

    Thread Starter leatherbarrow

    (@leatherbarrow)

    Hi Doug,

    Thanks so much for your prompt and helpful reply. I’ve actually worked it out. I will try to clarify for others in the same situation.

    I am building a site with a custom theme I have built from scratch. I wanted to use a fading slideshow (bannerspace plugin) in the header of the home page only, which is a static page. I then wanted to use a different static banner on every other page. In essence every page would have a different banner.

    The way I achieved it was with conditionals. The code is as follows:

    I placed this code inside the “banner” div on the “header.php” page:

    <div id=”banner”>

    <?php if( is_front_page() )
    {echo do_shortcode(‘[bannerspace]’); }
    ?>

    <?php if( is_page( ‘about-us’ ) )
    {echo “<img src=’http://mysite.com/wp-content/themes/mytheme/ images/aboutBanner.jpg’/>”; }
    ?>

    <?php if( is_page( ‘contact-us’ ) )
    {echo “<img src=’http://mysite.com/wp-content/themes/mytheme/ images/contactBanner.jpg’/>”; }
    ?>

    </div><!–END banner–>

    Thread Starter leatherbarrow

    (@leatherbarrow)

    Thanks guys

    Thread Starter leatherbarrow

    (@leatherbarrow)

    Just to further clarify.

    I originally decided to take the “banner” div out of the “header.php” file and place it at the top of each template page and just change the image link on each page to achieve the different banner images.

    That’s when I realised that the “news” page which was selected in my Reading settings as my posts page wasn’t displaying the header, hence the original question.

    I hope this is clear enough to help anyone else in a similar situation.

    Thanks.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Posts Page Ignoring Template’ is closed to new replies.