Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • bouinfrederic

    (@bouinfrederic)

    What I mean is through using firebug you can find and target the specific css classes and ids you would need to edit. Say if you can’t figure out how to change the colour of a specific title on your website all you need to do it right click on it in firefox, click “inspect element in firebug” and firbug will tell you it’s properties. For example, it might be <h1 class=”mainTitle”>the title</h1>. Then you know that if you go to your css in your editor and type:

    .mainTitle {
           color:  "red";
    }

    Then the colour of .mainTitle will be red. You can do that with any element, you can even change the colour directly in firebug to preview what it will look like before going and making the change in your editor.

    Hi dpeel,

    If you want to change the color of the entire header you can target the id #masthead or the class .site-header (for this to work I believe you would need to remove the background image). If you want to change only the nav you should be able to target the class .navbar.

    Are you familiar with dev tools? They are very helpful for this sort of thing. In Chrome right click on any element of a webpage, and click inspect element and you’ll see below all the html of the page and be able to find the different id’s and classes of each section. This way you’ll be able to easily find what you need to target to change colours.

    If you are using firefox I would download firebug for this purpose.

    Hope this helps

    Forum: Hacks
    In reply to: query_posts alternative
    Thread Starter bouinfrederic

    (@bouinfrederic)

    By the way this is what I am trying to do, I’ve replaced:

    query_posts('post_type=portfolio&posts_per_page=10');

    with:

    add_action( 'pre_get_posts', 'add_my_post_types_to_query' );
    
    function add_my_post_types_to_query( $query ) {
    	if ( is_page( 8 ) && $query->is_main_query() )
    		$query->set( 'post_type', array( 'portfolio' ) );
    	return $query;
    }

    This seems like the right track, but it stills doesn’t work. I’m not getting the posts from my custom post type.

Viewing 3 replies - 1 through 3 (of 3 total)