• Hi can anyone help please I have categories set up and i wont the post to show in full on the post page rather then the excerpt and read more button which takes you the the post ? can anyone help ?

    thanks

Viewing 8 replies - 1 through 8 (of 8 total)
  • sorry, your question is not very clear.

    Do you mean you are not able to see the post content in full in post page? Rather you are only seeing excerpt and a Read More button?

    Can you explain your requirement in detail?

    Thread Starter lilleyr

    (@lilleyr)

    Hi so I have a few categories set up and posts in each one. I have set these to a widget side bar. So when I click on “category 1” it shows the “2 posts” with title, pic and read more button.

    But I would like to just show the full post and not have to click read more to show the post.

    Its only 1 line of text and a download link.

    Does that help ? thanks

    Thread Starter lilleyr

    (@lilleyr)

    Hi did that help ?

    I do’t know much about the template you are using. But what you are saying is basically you want to show full posts in category page rather than having teasers.

    If I understand correctly you have to create a php file named categopry.php in your theme’s root directory. In this page retrieve all posts under selected category and loop through them to display information the way you want.

    In category.php:

    
    $cat_name = single_cat_title('', false); //gets you current term name
    $this_cat = get_category_object($cat_name); // see below for f(n) body
    $cat_id = $this_cat->term_id;
    $posts = get_posts_by_category_id($cat_id, 'trips', 24); // see below for f(n) body
    
    <?php foreach($posts as $post) : setup_postdata($post); ?>
      <!-- Extract your data for each post -->
      <div>
        <p><?php echo the_title(); ?> </p>
        <p><?php echo the_content(); ?> </p>
        <p><?php echo get_the_post_thumbnail(); ?> </p>
      </div>
    <?php endforeach ?>
    

    In your functions.php write the following functions:

    
    function get_category_object($cat_name){
      $term = get_term_by('name', $cat_name, 'category');
      return $term;
    }
    

    and

    
    function get_posts_by_category_id($cat_id, $post_type, $records_per_page){
      $currentPage = get_query_var('paged');
      $args = array(
         'category' => $cat_id,
         'post_type' => $post_type,
         'paged' => $currentPage,
         'posts_per_page' => $records_per_page
      );
      $posts = get_posts($args);
      return $posts;
    }
    

    Let me know if this helps.

    Thread Starter lilleyr

    (@lilleyr)

    Thanks ill try that and let you know

    Thanks

    Thread Starter lilleyr

    (@lilleyr)

    Hi No that does not seem to have done anything, its still the same ?

    Hi,

    In your theme options check this setting:

    Theme Options -> Blog -> Posts -> Enable post excerpts (We suggest that disble this options)

    Thank you

    Thread Starter lilleyr

    (@lilleyr)

    Hi yes I have done that .. i gave up and changed themes.. thanks

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘category posts – show in full’ is closed to new replies.