Wall display on Category pages. [Daily Theme]

Hi,

First, I really like the new BP Daily theme. Well done!
This is my site with it.
http://regionofinterest.com/

My question:
When selecting a category page.. Like "Advertising" or "Short Films" then the post are being displayed in just the title.
http://regionofinterest.com/blog/category/short-films/

Is it possible to display the post the same as on the homepage? Just the thumbnails.. in a 'Wall' format?

Thanks,
Stef

  • Tammie

    @Stef1978: Glad you like the theme. The way the wall works currently is just taking all however you can easily adapt that now you'd need to do this on the archive unless you get into category templates. It would however be easy enough to do assuming I've got the jist of what you want to have:

    1. Open up archive.php from line 8 to line 26 remove the following - I'd suggest you then save this under your child theme so that you can make sure you can still update your parent without any issues:

    <?php locate_template( array( '/library/components/header.php' ), true ); ?>
    <?php if ( have_posts() ) : ?>
    <?php while (have_posts()) : the_post(); ?>
    <?php if( $bp_existed == 'true' ) { //check if bp existed ?>
    <?php do_action( 'bp_before_blog_post' ) ?>
    <?php include (TEMPLATEPATH . '/library/components/buddypress/buddypress-postloop.php'); ?>
    <?php do_action( 'bp_after_blog_post' ) ?>
    <?php } else { // if not bp detected..let go normal ?>
    <?php include (TEMPLATEPATH . '/library/components/postloop.php'); ?>
    <?php } ?>
    <?php endwhile; ?>
    <?php locate_template( array( '/library/components/pagination.php' ), true ); ?>
    <?php else: ?>
    <?php locate_template( array( '/library/components/messages.php' ), true ); ?>
    <?php endif; ?>
    </div>
    <?php if($bp_existed == 'true') : ?>
    <?php do_action( 'bp_after_archive' ) ?>
    <?php endif ?>

    2. Now bare with me as doing this as 'theory' haven't actually done it. I'd then say create a file called category-wall.php.

    3. In category-wall.php write the following:

    <?php
    $wall_num = get_option('dev_buddydaily_wall_number');
    ?>
    <div class="wall-content">
    <?php query_posts('posts_per_page='. $wall_num . ''); $count == 1;?>
    <?php while (have_posts()) : the_post(); ?>
    <div class="wall-block">
    " rel="bookmark" title="<?php the_title_attribute(); ?>"> <span class="attach-post-image-wall" style="height:100px;width:213px;display:block;background:#e8e8e8 url('<?php the_post_image_url($cat_image_display); ?>') center center no-repeat"> </span>
    <div class="dark-container">

    <h6>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></h6> <span class="byline"><?php comments_popup_link( __( 'No Comments »', 'bp-daily' ), __( '1 Comment »', 'bp-daily' ), __( '% Comments »', 'bp-daily' ) ); ?></span>
    </div>
    </div>
    <?php if (($count == 2) || ($count == 5) || ($count == 8) || ($count == 11) || ($count == 14) || ($count == 17)){
    ?>
    <div class="clear"></div>
    <?php
    }
    ?>
    <?php $count++; ?>
    <?php endwhile; ?>
    <div class="clear"></div>
    </div>

    Now this raises 2 issues. Do you want to have unlimited numbers showing? Do you want to have it like an archive having next / previous posts... much more work would be required for this. Do you want to have it using the theme options number? My example assumes you want to use the theme options number but you could just replace:

    <?php
    $wall_num = get_option('dev_buddydaily_wall_number');
    ?>
    <div class="wall-content">
    <?php query_posts('posts_per_page='. $wall_num . ''); $count == 1;?>

    with the following for unlimited (pagination you will have to work out yourself):


    <div class="wall-content">
    <?php query_posts(); $count == 1;?>

    3. Save then link up under archive.php using:

    locate_template( array( 'category-wall.php' ), true );

    Now you have another issue you see the count is set if you notice in this code to create the wrapping / clear on the 3rd so it all slots nicely if you have a longer title rather than becoming css tetris :slight_smile:

    <?php if (($count == 2) || ($count == 5) || ($count == 8) || ($count == 11) || ($count == 14) || ($count == 17)){
    ?>
    <div class="clear"></div>
    <?php
    }
    ?>

    You're going to have to do something to work that one out yourself but I should have helped you get on your way with things.

  • Tammie

    Hmm editing not happening with above post... to add to this if you however wanted to just show thumbnails you don't need to do that count stuff / add clear that's for if don't know the height of the actual div element you are showing so no titles and just thumbnails that link would be easy to adapt the above code to just remove the title calls and have the thumbnails wrap around automatically.

    I do like the idea though and definitely consider it as part of a future update / option with Daily as think that the wall would work great for categories / archives even search.

  • Stef1978

    @Tammie,

    thanks alot!
    Though I've lost you after point 3. I'm terrible at coding.

    Where do I have to put this line?
    locate_template( array( 'category-wall.php' ), true );

    this is my archive.php now.

    <?php get_header(); ?>
    <div id="content">
    <div class="padder">
    <?php if($bp_existed == 'true') : ?>
    <?php do_action( 'bp_before_archive' ) ?>
    <?php endif ?>
    <div class="page" id="blog-archives">

    </div><!-- .padder -->
    </div><!-- #content -->
    <?php if( $bp_existed == 'true' ) { //check if bp existed ?>
    <?php locate_template( array( '/library/sidebars/bp-sidebar-blog.php' ), true ); ?>
    <?php } else { // if not bp detected..let go normal ?>
    <?php locate_template( array( '/library/sidebars/sidebar-blog.php' ), true ); ?>
    <?php } ?>

    <?php if (($count == 2) || ($count == 5) || ($count == 8) || ($count == 11) || ($count == 14) || ($count == 17)){
    ?>
    <div class="clear"></div>
    <?php
    }
    ?>

    <?php get_footer(); ?>

    Was it also correct to add that last piece of code to the archive.php and not the category-wall.php?

    Thanks again.

  • Stef1978

    @Tammie,

    thanks alot!
    Though I've lost you after point 3. I'm terrible at coding.

    Where do I have to put this line?
    locate_template( array( 'category-wall.php' ), true );

    this is my archive.php now.

    <?php get_header(); ?>
    <div id="content">
    <div class="padder">
    <?php if($bp_existed == 'true') : ?>
    <?php do_action( 'bp_before_archive' ) ?>
    <?php endif ?>
    <div class="page" id="blog-archives">

    </div><!-- .padder -->
    </div><!-- #content -->
    <?php if( $bp_existed == 'true' ) { //check if bp existed ?>
    <?php locate_template( array( '/library/sidebars/bp-sidebar-blog.php' ), true ); ?>
    <?php } else { // if not bp detected..let go normal ?>
    <?php locate_template( array( '/library/sidebars/sidebar-blog.php' ), true ); ?>
    <?php } ?>

    <?php if (($count == 2) || ($count == 5) || ($count == 8) || ($count == 11) || ($count == 14) || ($count == 17)){
    ?>
    <div class="clear"></div>
    <?php
    }
    ?>

    <?php get_footer(); ?>

    Was it also correct to add that last piece of code to the archive.php and not the category-wall.php?

    Thanks again.

  • Stef1978

    @Tammie,

    It would be a great feature for a future update. I agree with you on the thumbnails.. And using the themeoptions postcount is just fine.
    but I'm completely lost with what to remove.

    If added the 2 php files as attachment. Would you please set the correct code in there?
    I didn't add the locate_template( array( 'category-wall.php' ), true ); line yet.
    http://regionofinterest.com/wp-content/images/Archief.zip

    Thank you!

  • Tammie

    @stephy1978: Unfortunately it does require some coding knowledge to do this so hopefully you're not too bad :slight_smile: I'll recap these points:

    1. in category-wall.php (your new file)

    <?php
    $wall_num = get_option('dev_buddydaily_wall_number');
    ?>
    <div class="wall-content">
    <?php query_posts('posts_per_page='. $wall_num . ''); $count == 1;?>
    <?php while (have_posts()) : the_post(); ?>
    <div class="wall-block">
    " rel="bookmark" title="<?php the_title_attribute(); ?>"> <span class="attach-post-image-wall" style="height:100px;width:213px;display:block;background:#e8e8e8 url('<?php the_post_image_url($cat_image_display); ?>') center center no-repeat"> </span>
    <div class="dark-container">

    <h6>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></h6> <span class="byline"><?php comments_popup_link( __( 'No Comments »', 'bp-daily' ), __( '1 Comment »', 'bp-daily' ), __( '% Comments »', 'bp-daily' ) ); ?></span>
    </div>
    </div>
    <?php if (($count == 2) || ($count == 5) || ($count == 8) || ($count == 11) || ($count == 14) || ($count == 17)){
    ?>
    <div class="clear"></div>
    <?php
    }
    ?>
    <?php $count++; ?>
    <?php endwhile; ?>
    <div class="clear"></div>
    </div>

    2. in archive.php once removed all said to remove put the following where you removed the other content:
    locate_template( array( 'category-wall.php' ), true );

    Basically here you are saying 'use this file'.

    Make sure to remove what I said remove otherwise it will bug out. As I say I've not tested this and it is a bit more advanced coding so you may want to take some time doing it. You're also going to run into the issues I outlined if you don't know coding.

  • Tammie

    If you do not care about having titles then put this in your category-wall.php:


    <div class="wall-content">
    <?php query_posts();?>
    <?php while (have_posts()) : the_post(); ?>
    <div class="wall-block">
    " rel="bookmark" title="<?php the_title_attribute(); ?>"> <span class="attach-post-image-wall" style="height:100px;width:213px;display:block;background:#e8e8e8 url('<?php the_post_image_url($cat_image_display); ?>') center center no-repeat"> </span>
    </div>
    <?php endwhile; ?>
    <div class="clear"></div>
    </div>

  • Tammie

    Hmm for some reason the posting of this is causing the edit to loose the link tag. Look at the bit after line 7 in library/components/content-thewall.php and make sure it has the a href part (will try and paste here again but it keeps loosing it:

    " rel="bookmark" title="<?php the_title_attribute(); ?>"> <span class="attach-post-image-wall" style="height:100px;width:213px;display:block;background:#e8e8e8 url('<?php the_post_image_url($cat_image_display); ?>') center center no-repeat"> </span>

  • Tammie

    @Stef1978: I'm afraid I won't be updating the files for you this is personal customisation but you should be able to get there from my steps. Just make sure you do the last one I put as the code tags on this forum are loosing my link part therefore making it incorrect if you literally paste that. The big key is the page I said for the content wall you're basically taking all of that library/components/content-thewall.php. Also bare in mind this is all theory from me I've not done it myself yet. You also have to bare in mind an archive will need to be able to show unlimited number of posts so restricting with the limits you've got in the content wall file won't work hence as I said you'd have to adapt that.

  • Tammie

    @stef1978: You may have to change the css a bit as I said unfortunately I'd not tested it with the archive page so can't say. Maybe change the query bit to:

    <?php if ( have_posts() ) : ?><br />
    				<?php while (have_posts()) : the_post(); ?>

    That could replace:

    <?php query_posts('posts_per_page='. $wall_num . ''); $count == 1;?><br />
    			<?php while (have_posts()) : the_post(); ?>

    But you'd need to also add:

    <?php endwhile; ?><br />
    				<?php locate_template( array( '/library/components/pagination.php' ), true ); ?><br />
    			<?php else: ?><br />
    					<?php locate_template( array( '/library/components/messages.php' ), true ); ?><br />
    			<?php endif; ?>

    At the bottom or just:

    <?php endwhile; ?></p>
    <p>			<?php endif; ?>

    My only thoughts with the layout are as said CSS or you have a misplaced div perhaps as in an extra one or need an extra one.. one of those :slight_smile:

  • Stef1978

    @Tammie

    Sadly it didn't work. Though I really want to thank you for your effort.
    I give up for now and stick with the normal version. My coding skills are just to low.

    I do agree with you that archive pages have to show unlimited number of posts. But their shown in a main menu and I think the visitors will expect more behind that menu. I think a good pagination will tackle this. So it would be great when you take this issue within an upgrade of this theme. I will be gladly testing it. :slight_smile:

    Thanks again,
    Stef

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.