WordPress.org

Ready to get started?Download WordPress

Forums

using page template to theme photoblog section of site (4 posts)

  1. jivyb
    Member
    Posted 8 years ago #

    Hi. I have a "regular" wordpress blog but I'm trying to add a photoblog section to it that uses a different WP theme, one specifically for photoblogs. There might be a simpler way, but I was thinking I could add a page template for the photoblog section. In the page template file (which is basically the photoblog theme's index.php file), is there a way to call the photoblog theme's header and footer instead of the main site's header and footer? Could I use

    <?php get_header(2); ?>

    and name the file header2.php or something like that?

  2. moshu
    Member
    Posted 8 years ago #

    Not really. get_header is a function defined in the core WP files, so it will not "listen" to any other thing you add to it :)

    If you have another header file (give it a different name!) in the theme directory, then you can call it by:
    <?php include (TEMPLATEPATH . '/newheader.php'); ?>
    Don't change anything in this code, except your file's name!

  3. jivyb
    Member
    Posted 8 years ago #

    Thanks so much. I've spent the whole evening working on this and I'm close. Now I'm hung up on trying to adapt the following using your code above:

    <?php wp_get_archives('type=monthly&format=link');

    I've tried

    <?php include (TEMPLATEPATH . '/parchives.php', 'type=monthly&format=link'); ?>

    but I get php errors. If I leave out the bit on the monthly format, I get a message telling me I have a mysql error. Do you have any further ideas?

    Thanks!

  4. moshu
    Member
    Posted 8 years ago #

    <?php include (TEMPLATEPATH . '/parchives.php', 'type=monthly&format=link'); ?> <-- this one will not work, for sure.
    The code I gave you is ONLY for including a different header in a WP template file. That's what you were asking for. Not including the Page template in something else!
    For displaying the archives in the way you want you should have the template tag in the template file.
    But I am not a photoblog person, so I don't know how that photoblog stuff interacts with WP.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.