Forum Replies Created

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter tommysvr

    (@tommysvr)

    So I now have this, which successfully shows future posts on the taxonomy page. However, it still shows published posts as well. Anyone know of a way to modify this to hide published posts?

    if ( !is_admin() ) :
    function __include_future( $query )
    {
        if ( $query->is_tax() || $query->is_single() || $query->is_page() )
            $GLOBALS[ 'wp_post_statuses' ][ 'future' ]->public = true;
    }
    add_filter( 'pre_get_posts', '__include_future' );
    endif;
    Thread Starter tommysvr

    (@tommysvr)

    Hi,

    It’s pretty straight forward – you could put that pretty much anywhere in the theme. The most likely spot would be in sidebar.php

    I haven’t been able to look through that theme much and have never used it, so I’m not sure about the styling, but you could possibly just add this to the sidebar and see how it shows up:

    <!--widget start -->
    	<div id="categories" class="dbx-box suf-widget widget_categories">
    	  <div class="dbx-content">
    	  <h3 class="dbx-handle <?php echo $suf_sidebar_header;?>"><?php _e('Categories', 'suffusion'); ?></h3>
    	    <?php
    if (is_category()) {
    $this_category = get_category($cat);
    if (get_category_children($this_category->cat_ID) != "") {
    wp_list_categories('hide_empty=0&title_li=&child_of=' . $this_category->cat_ID);
    }
    else {
    $parent = $this_category->category_parent;
    wp_list_categories('hide_empty=0&title_li=&child_of=' . $parent);
    }
    }
    ?>
    	  </div>
    	</div>
    	<!--widget end -->

    Hope that helps somewhat.

    Thread Starter tommysvr

    (@tommysvr)

    Perfect! Thank you very much! ??

    Thread Starter tommysvr

    (@tommysvr)

    Nevermind! This does the job exactly:

    <?php
    if (is_category()) {
    $this_category = get_category($cat);
    if (get_category_children($this_category->cat_ID) != "") {
    wp_list_categories('hide_empty=0&title_li=&child_of=' . $this_category->cat_ID);
    }
    else {
    $parent = $this_category->category_parent;
    wp_list_categories('hide_empty=0&title_li=&child_of=' . $parent);
    }
    }
    ?>
Viewing 4 replies - 1 through 4 (of 4 total)