How to add HTML content type in wordpress mail


remove_filter( 'wp_mail_content_type', 'set_html_content_type' );

function set_html_content_type() {

    return 'text/html';
}



Simply paste above code in to your function.php file

Advertisements

How to change WordPress default FROM NAME


Simply paste the following snippet into your functions.php file

Don’t forget to put the desired FROM NAME on return

add_filter( 'wp_mail_from_name', 'my_mail_from_name' );
function my_mail_from_name( $name )
{
    return 'VENU';
}

How to Display Post related Category Names


How to Display  Post related Category Names

<?php if ( is_object_in_taxonomy( get_post_type(), 'category' ) ) : // Hide category text when not supported ?>
            <?php
                /* translators: used between list items, there is a space after the comma */
                $categories_list = get_the_category_list( __( ', ', 'theme' ) );
                if ( $categories_list ):
            ?>
            <h4>
                <?php printf( __( '%2$s', 'theme' ), 'entry-utility-prep entry-utility-prep-cat-links', $categories_list);
                  ?>
            </h4>
<?php endif; // End if categories ?>
 <?php endif; // End if is_object_in_taxonomy( get_post_type(), 'category' ) ?>

Query post page navigation in wordpress


Problem : Page navigation problem with custom query ?

Solution :  Find below

wp_Pagenavi    in query posts:

  1.         Download the Pagenavi plugin from the wordpress
  2.         Install plugin & active plugin
  3.         finally  use the below code     
<?php query_posts('showposts=6'.'&paged='.get_query_var('paged') ;?>
<?php while ( have_posts() ) : the_post(); ?>
<?php the_content();?>
<?php endwhile; // end of the loop. ?>
<?php wp_pagenavi() //call pagenavi?>