Past below code snippet right before loop and change category ID!
1 2 3 4 5 6 |
<?php if (is_home()) { $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; query_posts("cat=-288&paged=$paged"); } ?> |
Full Stack LAMP, MEAN, DevOps Consultant
Past below code snippet right before loop and change category ID!
1 2 3 4 5 6 |
<?php if (is_home()) { $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; query_posts("cat=-288&paged=$paged"); } ?> |
Withing the loop – it will display the post tags
1 2 3 4 5 6 |
$posttags = get_the_tags(); if ($posttags) { foreach($posttags as $tag) { echo '<a href="'.$tag->slug.'" title="'.$tag->name.'">'.$tag->name .'</a> '; } } |
1 2 3 4 5 6 |
$tags = get_tags(); if ($tags) { foreach ($tags as $tag) { echo '<a href="' . get_tag_link( $tag->term_id ) . '" title="' . sprintf( __( "View all posts in %s" ), $tag->name ) . '" ' . '>' . $tag->name.'</a> '; } } |
Redirect to different landing page after successful login on wordpress admin panel, if user not a super admin. In your theme’s functions.php:
1 2 3 4 5 6 7 8 9 10 |
function your_login_redirect() { if(!is_super_admin()){ return admin_url( 'edit.php' ); } else { return admin_url(); } } add_filter( 'login_redirect', 'your_login_redirect'); |
1 2 3 4 5 6 7 8 |
function titleRestrictionFilter($title){ global $post; $title = $post->post_title; $restrictedWord = "forbidden"; if (stristr( $title, $restrictedWord)) wp_die( __('Error: This title is containing restricted word') ); } add_action('publish_post', 'titleRestrictionFilter'); |
1 2 3 4 5 6 7 |
function titleLimitChar($title){ if(strlen($title) > 55 && !(is_single()) && !(is_page())){ // not in single post page and page. $title = substr($title,0,55) . ".."; } return $title; } add_filter( 'the_title', 'titleLimitChar' ); |
1 2 3 4 5 6 7 8 9 10 11 12 13 |
<?php query_posts('cat=-1'); ?> <?php if (have_posts()) : ?> <?php while (have_posts()) : the_post(); ?> <h3></h3> <p><?php the_time('F jS, Y') ?></p> <?php the_content(); ?> <?php endwhile; ?> |