WordPress.org

Forums

How To Make Category Like This ??? (9 posts)

  1. v123shine
    Member
    Posted 2 years ago #

    I want to make category like this => view image http://i.imgur.com/JZg47.jpg

    Note:
    I want make a category with first post have "images, title and short description". others 3 post (2,3,4 post) only have "title"

    Can someone help me, please!

    Thank you

  2. JungleSpace.net
    Member
    Posted 2 years ago #

    Here's a documentation to tell you more about how post are displayed in a list.

    http://codex.wordpress.org/The_Loop

    Different themes have different approaches but the every theme should follow the same basic concept.

  3. v123shine
    Member
    Posted 2 years ago #

    Thank you so much JungleSpace.net for help me.

    Can you give to me the php code to display the first post with image and short description and other post only title, please!

  4. JungleSpace.net
    Member
    Posted 2 years ago #

    Unfortunately, if you're looking for a full code customization, the better site to seek help is on the Job Board.

    http://jobs.wordpress.net/

  5. alchymyth
    Forum Moderator
    Posted 2 years ago #

    what is the current code of your category archive template?

    where is the image coming from? are you using the 'featured image' for this, or just the first image from the post?

    please post a link to your site to illustrate what you have so far.

    some links:

    http://codex.wordpress.org/Function_Reference/the_post_thumbnail
    http://codex.wordpress.org/Function_Reference/the_excerpt
    http://codex.wordpress.org/Function_Reference/the_title

  6. v123shine
    Member
    Posted 2 years ago #

    Thank you so much Alchymyth for help me.

    This is my site url: http://linkopen.net/3njy

    I create manual the template.

    This is the code of my category

    <!--Bola-->
    <div class="ks_category_left">
    <h1 class="ks_h1_title_item1">Bola</h1>
    <?php $recent = new WP_Query("cat=4&showposts=3"); while($recent->have_posts()) : $recent->the_post();?>
    <div class="ks_posts_item1">
    <div class="ks_postimage">
    <a href="<?php the_permalink() ?>" title="<?php the_title_attribute(); ?>">
    <?php get_the_image( array( 'size' => 'thumbnail', 'default_image' => 'http://kabarsore.com/noimages.jpg') ); ?>
    </a>
    </div>
    <div class="ks_title_desc">
    <div class="ks_postinfo">
    <a href="<?php the_permalink() ?>" title="<?php the_title_attribute(); ?>">
    <h4><?php $tit = the_title('','',FALSE); echo substr($tit, 0, 60); if (strlen($tit) > 60) echo " ..."; ?></h4>
    </a>
    </div>
    <div class="ks_desc">
    <?php echo get_excerpt(145); ?>
    </div>
    </div>
    </div>
    <?php endwhile; ?>
    </div>
    <!--end Bola-->

    # where is the image coming from? are you using the 'featured image' for this, or just the first image from the post?

    Image come from first thumb image on post and i using plugin "Get the Image" to display the image.

    Please help me.

  7. alchymyth
    Forum Moderator
    Posted 2 years ago #

    a general idea; might need a lot of formatting:

    http://pastebin.com/CSN7KhR0

  8. v123shine
    Member
    Posted 2 years ago #

    Great idea, you solve my problem :)

    Others question, i think i need using the 'featured image' for first post, can you give to me the full code please!

    Thank you so much Alchymyth for help me :)

  9. alchymyth
    Forum Moderator
    Posted 2 years ago #

    try to replace the 'get_the_image()' line with 'the_post_thumbnail()'

    http://codex.wordpress.org/Function_Reference/the_post_thumbnail

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.