Forums

Page-specific CSS elements (9 posts)

  1. OC2PS
    Member
    Posted 5 months ago #

    I am using a standard WP theme (Weaver). It is a customizable theme which I have customized from the Theme Admin.

    So far I love the theme.

    There is one page, though, where I want a particular element to be styled differently compared to other pages. How can I specify page-specific CSS?

  2. SwansonPhotos
    Member
    Posted 5 months ago #

    Weaver has many page templates, when creating a page, select a different page template or you can create your own and use that.

  3. OC2PS
    Member
    Posted 5 months ago #

    I don't really want to change the template...just to change the CSS for one lousy little element. Is there an easy way of doing that?

  4. SwansonPhotos
    Member
    Posted 5 months ago #

    Site link and exactly what do you wnat to change?

  5. OC2PS
    Member
    Posted 5 months ago #

    The site is not launched/public yet, so unable to share link here yet.

    I have a custom menu on top of page, and on one page I want to change the background of one of the menu items.

  6. Shailesh
    Member
    Posted 5 months ago #

    I think you have to use condition for this........

    //Get id of current page
    <?php
    $var = get_the_ID();
    if($var == "Your page id")
    {
    ?>
        your style here......
    <?php
    }
    ?>
  7. OC2PS
    Member
    Posted 5 months ago #

    Where would I need to put this code?

  8. Shailesh
    Member
    Posted 5 months ago #

    You have to put this code in your template file.

  9. OC2PS
    Member
    Posted 4 months ago #

    Site is http://www.csillamvilag.com

    All I needed to do was create a custom variable page-head-code and on the pages that I wanted things differently, put the CSS as values of this variable.

Reply

You must log in to post.

About this Topic