WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Give Pages Widget its own "class" or "id" for custom CSS (3 posts)

  1. Rb1368
    Member
    Posted 2 years ago #

    Is there a way to single out the pages widget to give it its own CSS rules that wont apply to the other widgets? For instance If I want to change the pages lings to a bigger font size and color and I edit the css .sidebar a{} its going to change all the links in the side bar that color. What is the most recommended way for separating the sidebar widget from all the other widgets in the sidebar?

    Next thing that comes to my head is to just "view page source" and then use the ID or CLASS wordpress is giving the menu when it renders it out? not sure...

  2. Pioneer Valley Web Design
    Member
    Posted 2 years ago #

    This can be done, basically...

    What I did was rather simple on my sites. In the right sidebar I have some pages listed. This is one of the two Menus. These are created using the WP Menu, but adding a CSS style. When you add an item to a Menu, you can expand that item to see a location to enter the style to be used. On the left are widgets using the my theme's defaults.

    Your theme must support Custom Menus...and you could use a theme that also supports custom widgets.

  3. Rb1368
    Member
    Posted 2 years ago #

    Thank you for your response SwansonPhotos. However I found a different work around. Your advice will and does work, but this is what I did.

    On my sidebar.php file I put this code:

    <li id="page_links">
    	<?php wp_nav_menu(); ?>
    </li>

    then in my style.css file I put this code:

    #sidebar #page_links {
        /*your rules here*/
    }

    Just in case someone needs advice on this I thought I would post what I did.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.