• pyroevil

    (@pyroevil)


    Hi,

    I use wordpress 3.8.1 with the theme tweenty fourteen. Unfortunetly , when you click on a category with no post assigned to it for now , it’s display a “not found” page. I try to make a plugins with hook that replace that by a text ( like the description of the category ). If no post is in the category , only description is displayed , if category have post , description is displayed and posts founds after.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Bryan Schneidewind

    (@bschneidewind)

    I would suggest removing your plugin as this can be directly managed on the default pages via wordpress.

    By default, when there are no posts to load it will call the content-none.php template.

    So, assuming everything is reverted to default, you’ll edit that template (content-none.php) and at line 25 and replace what is currently there with the following:

    <?php elseif ( is_category() ) : ?>
    
    	<?php
    		// Show an optional term description.
    		$term_description = term_description();
    		if ( ! empty( $term_description ) ) :
    		printf( '<div class="taxonomy-description">%s</div>', $term_description );
    		endif;
    	?>
    
    <?php else : ?>

    The existing should just be this:

    <?php else : ?>

    Thread Starter pyroevil

    (@pyroevil)

    Yes thanks !

    It’s what I finally be resigned to do ! ??

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to edit content of category page’ is closed to new replies.