Quick Wordpress Question...

Discussion in 'WordPress' started by BandonFlyer, Jul 18, 2010.

  1. #1
    I have a block of text (html formatting as well) that i include on a post at the bottom.

    It is conditional - I dont' use it on every page - but when I do use it, it has to be the same as the others...

    Also, the text changes a lot...

    I wanted to just create a separate template page and selectively "include" it on the posts i want to use it on. That way when i changes i only have one place to go to update it.

    How can i do that within Wordpress? I really do not want to install some plugin... just looking for a simple way...

    Thanks
     
    BandonFlyer, Jul 18, 2010 IP
  2. MelfromBoD

    MelfromBoD Active Member

    Messages:
    448
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    58
    #2
    What condition? Be more specific please
     
    MelfromBoD, Jul 18, 2010 IP
  3. BandonFlyer

    BandonFlyer Member

    Messages:
    194
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    26
    #3
    ? there's nothing to be specific about...

    The condition is "when" i want to put it in, i willl... again I'm looking for something similar to an "include" statement... a way of just having whatever html/text is in the other template displayed in line...
     
    BandonFlyer, Jul 18, 2010 IP
  4. zhoom

    zhoom Peon

    Messages:
    388
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #4
    You need to create a page template. To do this create a copy of your page.php file rename it page-yourtemplatename.php

    Then insert this code at the very top of the new php file:

    <?php
    /* 
    Template Name: yourtemplatename
    */
    ?>
    PHP:
    Then edit the template as necessary.

    It will appear as an option in the template dropdown menu (in your wp backend) when you create a new page.
     
    Last edited: Jul 18, 2010
    zhoom, Jul 18, 2010 IP