Quantcast
Channel: CSSReflex » WordPress
Browsing all 9 articles
Browse latest View live

CSS Cache-buster for WordPress

<link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo( 'stylesheet_url' ); ?>?<?php echo time(); ?>" /> Source

View Article



Load jQuery from Google CDN

function jquery_cdn() { if (!is_admin()) { wp_deregister_script('jquery'); wp_register_script('jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js', false, '1.8.3');...

View Article

Auto Generate Title for Custom Post Type

add_filter('wp_insert_post_data','dsgnwrks_update_title',99,2); function dsgnwrks_update_title($data, $postarr) { global $post; if ( !is_admin() ) return $data; if ($data['post_type'] == 'viewpoints')...

View Article

Exclude a category from the loop on your home page

function exclude_categories($query) { if ( $query->is_home ) { $query->set('cat', '-1,-5,-10'); } return $query; } add_filter('pre_get_posts', 'exclude_categories'); Source

View Article

Add Custom Class To Last Post In A Loop

// Add a class to the last post in a loop function last_post_class($classes){ global $wp_query; if(($wp_query->current_post+1) == $wp_query->post_count) $classes[] = 'last'; return $classes; }...

View Article


Automated Title for WordPress Custom Post Types

add_filter('wp_insert_post_data','dsgnwrks_update_title',99,2); function dsgnwrks_update_title($data, $postarr) { global $post; if ( !is_admin() ) return $data; if ($data['post_type'] == 'viewpoints')...

View Article

Remove WordPress Version from Header

Add the following code inside the functions.php remove_action('wp_head', 'wp_generator');

View Article

WordPress Pagination Without A Plugin

Add the following to functions.php in your theme directory:if ( ! function_exists( 'my_pagination' ) ) : function my_pagination() { global $wp_query; $big = 999999999; // need an unlikely integer echo...

View Article


Filter To Add .current-cat Class To Categories List In Single Post

Put this in functions.phpadd_filter('wp_list_categories','style_current_cat_single_post'); // filter to add the .current-cat class to categories list in single post function...

View Article

Browsing all 9 articles
Browse latest View live




Latest Images