WordPress.org

Ready to get started?Download WordPress

Forums

Is it possible to use a seperate template for a single "page"? (10 posts)

  1. DavidDeCristoforo
    Member
    Posted 9 years ago #

    I'm still working on my "email this article" thing. I've got the link working but the "page" that appears when you click on the link looks bad. I have been able to fix some of the issues by tweaking the wp-email file but the real problem is that this page wants to use the same three col. template and the same .CSS that appiles to the rest of the blog. Therfore, I can't really do what I want to the page without messing everything else up. So, I am wondering if it is possible to call a completely different template, like a simple single col. thing for this page only. You can see what I'm talking about by hitting the blog and clicking any of the "Email This Article" links.

    Thanx
    DD

  2. Mark (podz)
    Support Maven
    Posted 9 years ago #

  3. DavidDeCristoforo
    Member
    Posted 9 years ago #

    Cool. Now, suppose I wanted to use the "page" template in the default theme. How would I "force" wp-email to use that template?

    Thanx again.
    DD

  4. Lorelle
    Member
    Posted 9 years ago #

    If I understand you correctly, you have created a template called wp-email and included the header, sidebar, and footer that you want in it with include or get commands? Right?

    If you want a different header or style sheet, create a different header (copy the original and call it header2.php works) and use the include command to bring that in instead of the get. Like this:

    <?php
    /* Don't remove this line. */
    require('./wp-blog-header.php');
    include(get_template_directory() . '/header2.php');
    ?>

    Then you can put any style references you want in the new header.

    Does this answer your question?

  5. DavidDeCristoforo
    Member
    Posted 9 years ago #

    Remember, I'm way over my head here. It's a miracle I've gotten this far. Mostly due to the assistance of people on this forum. What I have is a wp-email.php file that is part of the "plug in" and it seems to use the template for the blog. It begins with:

    // Require WordPress Header
    require('wp-blog-header.php');

    // Require E-Mailer Class
    require(ABSPATH.WPINC.'/class-phpmailer.php');

    (The entire code is here)

    There is no "include" or "get" or anything beyond the above. So what I would like to do is to create (or download) a template or CSS called say, e-mail, that would have only one col. Then I would have to put that somewhere (where I don't know) and then add whatever I need to add to the wp-email,php file to make it use that template instead of the 3 col template used by the "rest" of the pages.

    I thank you for being patient with me because, like I said i am in way over my head here (but learning nonetheless!).

    Thanx Again
    DD

  6. Lorelle
    Member
    Posted 9 years ago #

    Okay, what you need to do is find every reference to get_header(); and change that to:

    include(get_template_directory() . '/header2.php');

    This is not going to be easy.

  7. Lorelle
    Member
    Posted 9 years ago #


  8. DavidDeCristoforo
    Member
    Posted 9 years ago #

    OK, you are still over my head. What I don't know is how to change the style reference for the file! In other words, what is it that says "use this template instead of that one"? "wp_blog-header.php" just looks like a bunch of code that I really don't understand. Feel free to tell me that I have no biz trying to do this with my limited understanding. I already know that! But what the heck! Like I said, it's a miracle I've gotten this far.

    Thanx Again
    DD

  9. Joshua Sigar
    Member
    Posted 9 years ago #

    In other words, what is it that says "use this template instead of that one"
    Are you referring to Page Template?

  10. DavidDeCristoforo
    Member
    Posted 9 years ago #

    Well I don't know. That's the problem! I was hoping that someone could tell me. When I downloaded the template I currently use there were only two files, index.php and styles.css plus some image files. I installed these in the root dir of my blog and that was it (using 1.2 then but now using 1.5). So. I was hoping I could install another template (or theme) in the themes dir. and then get the wp-email page to use that theme instead of the theme used by the rest of the blog. What I really want to do is to simplify the look of the "email this article" page.

    DD

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags