WordPress.org

Ready to get started?Download WordPress

Forums

Attach alternative stylesheet to template for one page (3 posts)

  1. indialogue
    Member
    Posted 6 years ago #

    Hi,

    I am trying to get this one page to look different from the rest http://indialogue.info/e-texts/vedanta-chart since it features a large table that I want to spread across the page. I want to do away with navigation elements (sidebar and leftbar) and just retain header and footer. And of course, put a link for "Return to previous page" so users can return to a page for navigation.

    I tried doing this through creating a new template: I deleted the commands for get sidebar and leftbar and assigned this template to this one page. The problem is: the width of the area the table can take up remains the same, as does the translucent background. Everything is still on the left side. I am guessing this has to do with the stylesheet.

    I read up a lot in the forum here on how to assign a new stylesheet to a template through changing the call in header.php but I am afraid I could not fix it. I don't really know my way around programming, just started 2 weeks ago with this site. Anyone willing to give me step by step instructions on fixing this problem? Help would be greatly appreciated, this is otherwise going to take me several weeks to figure out (I am teaching myself HTML from a book).

    Thanks for helping me get my site underway!

    Joy

  2. VelvetBlues.com
    Member
    Posted 6 years ago #

    Well, you could do it dynamically in the header using:

    <?php
    if(!is_page('vedanta-chart'){
    ?>
    <link rel="stylesheet" href="standard stylesheet location" type="text/css"/>
    <?php
    }
    else{
    ?>
    <link rel="stylesheet" href="unique stylesheet location" type="text/css"/>
    <?php
    }
    ?>

    Instead, however, I would suggest you simply create a new containing element and add the new css definition to the stylesheet. In addition, it looks like you have set your table width to 474px. If you want your table to expand, you will need to remove this and set it to the width that you'd like.

  3. indialogue
    Member
    Posted 6 years ago #

    Hi,

    thanks for the response! I tried posting your code into the header.php file, but I kept getting the message: error, unexpected in } in line x. I tried pasting it in several different lines, but that didn't help. Could you tell me what a containing element is, and how I define the css definition? Or where exactly I should be pasting this code? Sorry for the questions, but I just started out blogging. I appreciate your interest!

Topic Closed

This topic has been closed to new replies.

About this Topic