Support » Fixing WordPress » Can i show full post of 1 specific category

  • Guys please help me do this…Is it possible to show full post of 1 specific category…If yes how….??? Thanks all comments are welcome

Viewing 12 replies - 1 through 12 (of 12 total)
  • Review Template Hierarchy to determine the template you need to ‘change’ for your category.

    You might try copying your theme’s index.php to category-x.php (where the x is your category ID) and making sure the template tag, the_content(), is in use.

    Related:
    Stepping Into Template Tags
    Stepping Into Templates

    @ MichaelH thanks for the reply, but seriously i know little about programming..I found this tutorial in the how to section..And it teaches about replacing <?php the_excerpt() ?> with <?php the_content() ?> in archive.php in my default theme folder..But it shows full post of other category’s..And i want it to show only one specific category

    Try:

    <?php if(in_category('x') the content();
    else the_excerpt();?>

    where x = the id of the category that you want.

    Thanks esmi where will i put this code..

    This is the code for my archive.php

    [Code moderated as per the Forum Rules. Please use the pastebin]

    In place of <?php the_excerpt();?>

    Oh GOD Esmi i dont think i made a mistake..But its not working..Please help me i am really in need of this…This is how i did it.
    This is the Original Code

    <?php if ( $wp_genius_post_content == ‘Excerpts’ ) { ?>
    <?php the_excerpt(); ?>
    <?php } else { ?>
    <?php the_content(”); ?>
    <?php } ?>
    </div>

    And this what i did

    <?php if ( $wp_genius_post_content == ‘Excerpts’ ) { ?>
    <?php if(in_category(‘6’) the content();
    else the_excerpt();?>
    <?php } else { ?>
    <?php the_content(”); ?>
    <?php } ?>
    </div>

    Try:

    <?php if ( $wp_genius_post_content == 'Excerpts' && !in_category('6') ) { ?>
    <?php the_excerpt(); ?>
    <?php } else { ?>
    <?php the_content(''); ?>
    <?php } ?>
    </div>

    @ esmi…THANK YOUUUUuuu God richly bless u…Its working now..Uhmmm i have another similar problem, I have this music site which i want users to be able to search for one specific track in a post without the post title/header and again to be able to play, Thanks Again

    Sorry? I don’t follow you. Why can’t your users search for this track at the moment?

    They can search but not the way i want it.Let me show u some example here.. Example:

    New Album
    1.Wordpress

    2.Joomla

    3.Drupal

    4.Datalife Engine

    5.Flash

    Assuming these are the uploaded tracks on a page and the title of the page is New Album..I want to search for joomla, And want the search results to bring joomla only not with the title and the contents the joomla is in..I hope u get me.Thanks hope u solve this solution for me

    So I’m looking to do the same thing as Yesfree (have one category display full post, but my codes theme is a little different, so I’m having trouble taking esmi code and adding it to my themes code, any one out there to help, maybe esmi

    Code:

    /*this function allows for the auto-creation of post excerpts*/
    function truncate_post($amount,$echo=true) {
    	global $post, $shortname;
    
    	$postExcerpt = '';
    	$postExcerpt = $post->post_excerpt;
    
    	if (get_option($shortname.'_use_excerpt') == 'on' && $postExcerpt <> '') {
    		if ($echo) echo $postExcerpt;
    		else return $postExcerpt;
    	} else {
    		$truncate = $post->post_content;
    
    		$truncate = preg_replace('@\[caption[^\]]*?\].*?\[\/caption]@si', '', $truncate);
    
    		if ( strlen($truncate) <= $amount ) $echo_out = ''; else $echo_out = '...';
    		$truncate = apply_filters('the_content', $truncate);
    		$truncate = preg_replace('@<script[^>]*?>.*?</script>@si', '', $truncate);
    		$truncate = preg_replace('@<style[^>]*?>.*?</style>@si', '', $truncate);
    
    		$truncate = strip_tags($truncate);

    @ morg7801 please don’t leave me out when u are able to do it…Thanks

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Can i show full post of 1 specific category’ is closed to new replies.