Getting out side of wp root folder from function.php using absolute path

If you want the absolute path to your theme’s stylesheet directory you could use get_stylesheet_directory(). If you want the URI of your theme’s stylesheet directory you could use get_stylesheet_directory_uri(). get_theme_root() will return the absolute path to the themes directory. get_home_path() will return the absolute filesystem path to the root of the WordPress installation. Once you’ve … Read more

How do I get access to the CSS Editor

Without being rude, it will probably cost more to fix what you break instead of asking them in the first place! – however, you can’t learn until you break!. If I were you and you are interested in trying to play around with CSS/HTML – then you could always install WordPress locally on your Mac/PC, … Read more

How do I switch css class on post

First of all, never use query_posts, use WP_Query to create additional queries. You can target specific post positions in the loop by using the built in current_post var of the query object. Here’s an example using the post_class function: <?php $my_posts = new WP_Query( array( ‘posts_per_page’ => 3 ) ); if( $my_posts->have_posts() ): while( $my_posts->have_posts() … Read more

Different background for different page

Yes, that’s possible! For the default homepage, you can use this: body.home { background-color: #ff0000; } For a specific blog post, you can use this where 5 is its post ID: body.postid-5 { background-color: #00ff00; } And this is for a specific page and it’s the same where 5 is the page ID: body.page-id-5 { … Read more

Reduce font size [closed]

Not a WordPress question, but add the following in your stylesheet: .featured-text h2, .featured-text h2 a { font-size: 24px !important; /* set font size */ } In the future, simply Inspect Element to find which class or tag to style.

Extend Menu Walker Output

change this line: $item_output .= $args->link_before . apply_filters(‘the_title’, $item->title, $item->ID) . $args->link_after; to: $item_output .= $args->link_before . apply_filters(‘the_title’, substr($item->title, 0, 10), $item->ID) . $args->link_after; That limits the character to 10. Please note this substr($item->title, 0, 10).

Using Grunt and keeping theme comments

style.css may contain only comment with Theme Name: … . It just tells to WordPress about your theme. You have no need to load style.css in theme through tag <link … >. So. Now you can leave your only one css file main.css with all styles in <head>.