Graphene Child with Sidebar and Widgets

  • puffin


    I am using WordPress 3.4.2 with the Graphene Theme 1.8.2 with a Child Theme. I have just one sidebar on the RHS.

    I have a static front page but on all other pages I have up to 3 widgets that I can have (list-category-posts, text, sub-pages). These all work perfectly as long as I use the Default Template for the pages.

    As soon as I use any custom template (placed in wp-content/themes/graphene-child) the text and sub-pages widgets don’t show. The list-category-post widget continues to show.

    The text widget is supposed to show the link that I have now coded to show above the posts for this page.

    Can anyone help with this please?



    Here is the code for the page template

    * Template Name: future_concerts
    get_header(); ?>
    /* Run the loop to output the pages.
    * If you want to overload this in a child theme then include a file
    * called loop-page.php and that will be used instead.
    get_template_part( 'loop', 'page' );

    /* Check if the user selects specific category for the templated page */
    $cats = 'concerts'; // Change these category SLUGS to suit your use.
    // Display the posts from the category with a post_date in the future
    $args= array(
    'category_name' => $cats
    // The Query
    // $the_query = new WP_Query( $args );
    function filter_where($where = '') {
    $where .= " AND post_date >= '" . date('Y-m-d') . "'";
    return $where;
    add_filter('posts_where', 'filter_where');
    query_posts($query_string . 'category_name=concerts&order=ASC');

    $my_query = new WP_Query('category_name=concerts&order=ASC');

    // The Loop
    // while ( $the_query->have_posts() ) : $the_query->the_post();
    while ($my_query->have_posts()) : $my_query->the_post();
    // echo '<li>';
    // the_title();
    // the_content();
    get_template_part( 'loop', 'index' );
    // echo '</li>';
    /* Posts navigation. */
    // Reset Post Data
    <?php get_footer(); ?>

    Kenneth John Odle

    As soon as I use any custom template

    Why are you using this? What is the end-goal that you are trying to achieve? There may be an easier way to accomplish it without resorting to this method.



    It is the only way that I can see to have future concerts on one page and past concerts on another. I am running no-future-posts because I want one of the future concerts on the header slider and can’t see any other way to do that either.

    I tried using list-category-posts but can’t see how to make that work with date selection either. Also that method doesn’t seem to show the gallery.

    Do you have any other suggestions?



    Fixed !!!

    I removed this line and it works!!

    query_posts($query_string . 'category_name=concerts&order=ASC');

Viewing 5 posts - 1 through 5 (of 5 total)

  • You must be logged in to reply to this topic.
Graphene Themes Forum