Custom Logo wordpress Login Snippet

//custom login code AND hide register link function custom_login_logo() { echo ‘<style type=”text/css”>h1 a { background: url(‘.get_bloginfo(‘template_directory’).’/images/logo.png) 50% 50% no-repeat !important; height:100px !important; } body.login div#login p#nav {display:none; visibility:hidden !important;} #backtoblog{float:left; .password{float:left; margin:15px !important}</style>’; } add_action(‘login_head’, ‘custom_login_logo’); function my_login_title() { return get_option(‘blogname’); } add_filter(‘login_headertitle’, ‘my_login_title’); function custom_redirect_link() { echo ‘<p><a class=”password” href=’; echo wp_lostpassword_url(); echo Read More…

Get Category Post ID

This will help get and display the 1st category ID of the current post   $categories = get_the_category(); //get all categories for this post echo ‘first category is ‘ . $categories[0]->cat_ID;

Custom Excerpt Snippet

You can use this code in your functions.php file to change the excerpt length and also the ‘more’ tag. // Replaces the excerpt “more” text by a link function new_excerpt_more($more) { global $post; if (is_category( ’21’ )){ return ‘ View Image Gallery‘; } else { return ‘ Read the full article…‘; } } add_filter(‘excerpt_more’, ‘new_excerpt_more’); Read More…

Exclude Category

This is the code I got to work after realizing that the code I was using broke the pagination. <?php if ( is_home() ) { $paged = (get_query_var(‘paged’)) ? get_query_var(‘paged’) : 1; query_posts(‘cat=-21&paged=’.$paged); } ?> <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> The code below worked part way, but Read More…

WordPress Plugins

This is an ongoing list of plugins I have used that I find super useful. I hope to write a review of each one in the future. Advanced Custom Fields Gravity Forms Gravity Forms PDF extended Gravity Forms – Placeholders add-on Orangebox Twitter Tools Random Text The Events Calendar Simple 301 Redirects Social Gallery Plugin Read More…

Password Protected Page

Add this code outside the loop on the template page to enable password protection. <!–password protect code –> <?php if ( ! post_password_required( $post ) ) { ?> <!–password protect code –> CONTENT LOOP <!– end of the password protect –> <?php } else { echo get_the_password_form(); } ?> <!– end of the password protect Read More…

Placeholder Text

Add placeholder text for gravity forms with Gravity Forms – Placeholders add-on plugin.¬†Then add the class¬†gplaceholder to the form.   You can also use this code <script type=”text/javascript”> jQuery(document).ready(function($) { jQuery.fn.cleardefault = function() { return this.focus(function() { if( this.value == this.defaultValue ) { this.value = “”; } }).blur(function() { if( !this.value.length ) { this.value = Read More…