Make category as startpage?

Home Forums Using Thematic ( without a child theme ) Make category as startpage?

This topic is: not resolved

This topic contains 18 replies, has 2 voices, and was last updated by  Gene (emhr) 6 years ago.

Viewing 4 posts - 16 through 19 (of 19 total)
  • Author
  • #3219


    Found another code and used it in my regular theme in the index.php and it seems to works.

    if( is_home() ) {
    $args = array( ‘category__in’ => array(1) );
    $args = ( $wp_query && $wp_query->query ) ? array_merge( $wp_query->query , $args ) : $args;
    query_posts( $args );


    Seems like it works without the other php code in the childtheme.

    But anyway thank you for helping out! 🙂


    Gene (emhr)

    It’s getting pretty frustrating to spend the time to give good advice and to see crappy code suggested as the solution. Just because is seems to work dosn’t mean that you aren’t hurting your site’s performance.

    I wouldn’t recommend using that code and I don’t recommend or support using any other version of Thematic or WordPress other than the current releases.

    By using query_posts you’re discarding the original query and creating another one. So you’re basically hitting the database a second time when you dont need to.

    To quote the WordPress Codex entry on query_posts:

    It is strongly recommended that you use the pre_get_posts action instead, and alter the main query by checking is_main_query



    Ok I know what you mean, but I updated the wordpress and I set it back to childtheme now. Using your script in the fuctions.php. The startpage content dosen’t come up, I see just empty content and my buttons (without the category buttons).

    The debug says:

    To include:

    sidebar.php-mall i ditt tema. in /wordpress/wp-includes/functions.php on line 2881

    Just for the record Im not so good in PHP I only know HTML & CSS and some  Javascript.


    Gene (emhr)

    I really should have look at the forum this was posted in  and realized that you were using a modded version of Thematic from the start.

    Using a child theme is breaking your site because your using a customized version of Thematic. The forums here support using Thematic as a standalone theme if not modified *and* using Thematic with child themes.

    I think this is your best course of action now:

    1. Back up your modded version of Thematic to protect yourself from updating Thematic and overwriting your theme edits.
    2. Convert your existing Thematic theme to a child theme and then reinstall a fresh version Thematic.
Viewing 4 posts - 16 through 19 (of 19 total)

The topic ‘Make category as startpage?’ is closed to new replies.