customize continue reading

the css class .meta-nav might or might not be referenced in style.css or any other stylesheet of the theme. if your theme is Twenty Ten then the css class is not used in style.css – add it as a new style if you need.

calling an additional css and js links for a custom page template

wp_register_script( $handle, $src, $deps, $ver, $in_footer ); wp_register_style( $handle, $src, $deps, $ver, $media ); if (!is_admin()) { add_action(‘wp_enqueue_scripts’, ‘my_js’); // for js add_action(‘wp_enqueue_scripts’,’my_style’); // for css } function my_js(){ if(is_page(page id)){ // or is_page_template(page slug) wp_register_script( ‘port-js’, get_template_directory_uri() . ‘/portfolio-js.js’); wp_enqueue_script( ‘port-js ‘); } } function my_style(){ if(is_page(page id)){ // or is_page_template(page slug) wp_register_style( ‘port-style’, … Read more

Loading bbPress CSS file only on forum directory

The styles are enqueued in the function enqueue_styles() inside the file /wp-content/plugins/bbpress/templates/default/bbpress-functions.php. It’s a matter of using is_bbpress() and wp_dequeue_style. Only one of the styles is enqueued, but here we’re removing all 3 possibilities. add_action( ‘wp_enqueue_scripts’, ‘bbpress_enqueue_wpse_87081’, 15 ); function bbpress_enqueue_wpse_87081() { // Check if bbpress exists if( !function_exists( ‘is_bbpress’ ) ) return; if( !is_bbpress() … Read more

Using variable to display a page with a different stylesheet

if the url is www.example.com/page?style=alt, you can conditionally check the presence of $_GET[‘style’] when you’re including your styles. Add the following where you are enqueueing your syles(probably in functions.php): if(isset($_GET[‘style’]) && $_GET[‘style’]==’alt’){ wp_enqueue_script(‘alternate_style); else{ wp_enqueue_script(‘normal_style); }

Plugins not showing up for custom template

Always Put wp_head() in header and wp_footer() in footer. the plugin uses this hook Header.php: <?php … /* Always have wp_head() just before the closing </head> * tag of your theme, or you will break many plugins, which * generally use this hook to add elements to <head> such * as styles, scripts, and meta … Read more

Disable CSS for IE 8 and earlier.

Deregister twentytwelve-ie, which is registered (currently) in function.php on line 157. function dereg_ie_styles_wpse_99631() { wp_deregister_style(‘twentytwelve-ie’); } add_action( ‘wp_enqueue_scripts’, ‘dereg_ie_styles_wpse_99631′, 1000); That isn’t just IE8 though. It is registered as less than or equal to IE 9. If you want to remove all of the stylesheets for IE8 or less you are in for a bumpy … Read more