Forum Replies Created

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter o3world

    (@o3world)

    @alanfuller It is an original theme

    • This reply was modified 3 years, 11 months ago by o3world.
    Thread Starter o3world

    (@o3world)

    Was able to figure it out myself after some extended trial and error.

    Thread Starter o3world

    (@o3world)

    I found a work around for my problem. Wrap my custom query within a conditional statement. If ( get_query_var( ‘s’ ) == NULL ) then run my query otherwise do the default one.

    If anyone has a better solution I’m all ears.

    <?php 
    
    if ( get_query_var( 's' ) == NULL ) {
    
    	$temp_query 	= $wp_query;
    	$category 	= ( get_query_var( 'cat' ) ) ? get_query_var( 'cat' ) : -17;
    	$paged 		= ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1;
    	$author 		= ( get_query_var( 'author' ) ) ? get_query_var( 'author' ) : NULL;
    	$month		= ( get_query_var( 'monthnum' ) ) ? get_query_var( 'monthnum' ) : NULL;
    	$year		= ( get_query_var( 'year' ) ) ? get_query_var( 'year' ) : NULL;
    
    	// default category (all posts) returns as -0, if this is the case set it to -17 to ignore the 'news' category
    	if ( $category == -0 ) $category = -17;
    
    	$query_string = 'cat=' . $category . '&paged=' . $paged;
    
    	if ( $year != NULL && $month != NULL ) $query_string .= '&year=' . $year . '&monthnum=' . $month . '$&order=DSC';
    	if ( $author != NULL ) $query_string .= '&author=' . $author;
    
    	//echo $query_string;
    
    	query_posts( $query_string );
    
    }
    
    ?>
    Thread Starter o3world

    (@o3world)

    Nevermind. Solved it myself. Placed this before my Loop

    <?php
    	$temp_query = $wp_query;
    	query_posts('showposts=10&cat=-17');
    ?>
    Thread Starter o3world

    (@o3world)

    Looking into that right now. I’m assuming it’s not turned on because:

    A) I’m on a shared environment.
    B) Simply turning the RewriteEngine On in .htaccess breaks the site.

    Thread Starter o3world

    (@o3world)

    I moved the site to a staging server and I’m still having issues with my permalinks not working. Again in the “default” setting everything works fine. As soon as I change it to any kind of custom settings I get a 500 Internal Server Error on every page (home page, admin, blog, whatever).

    .htaccess with default settings
    # BEGIN WordPress

    # END WordPress

    .htaccess with /%year%/%monthnum%/%postname%/ settings
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>

    # END WordPress

    Any tips? I’ve been searching through the forums here but have yet to come up with any solid leads as to how to fix this.

    Thread Starter o3world

    (@o3world)

    Ahh, Thanks for the tip. I’m gonna try moving it to a DEV environment and see if that fixes it.

Viewing 7 replies - 1 through 7 (of 7 total)