Post Fetching Ignoring Sort_Column?

I’m not sure why you use the sort_column parameter, it’s not supported by the WP_Query() class. According to the Codex, the correct way to sort, is to use the order and orderby parameters. Please try this: $args = array( ‘post_type’ => ‘page’, ‘orderby’ => ‘menu_order’, ‘order’ => ‘ASC’, // DESC is the default order ‘post_status’ … Read more

the_content of template page

Have you tried using the whole loop? <?php $loop = new WP_Query(); if ( $loop->have_posts() ) : while ( $loop->have_posts() ) : $loop->the_post(); ?> <!– before –> <?php the_content(); ?> <!– after –> <?php endwhile; else: ?> <p><?php _e( ‘Nope. Doesn\’t exist’ ); ?></p> <?php endif; ?>

Why isn’t WordPress respecting my HTML?

Figured it out. You just need to add the following to your functions.php: remove_filter( ‘the_content’, ‘wpautop’ ); remove_filter( ‘the_excerpt’, ‘wpautop’ ); http://codex.wordpress.org/Function_Reference/wpautop#Disabling_the_filter

Add a static page that links to homepage

To add a link to the homepage in your navbar, you can use the following function to add a link to the home page in wp_page_menu_args function wpse01_home_link( $args ) { if ( ‘main-menu’ === $args -> theme_location){ if (! isset( $args[‘show_home’] ) ) $args[‘show_home’] = _x( ‘Home’, ‘homepage’ ); } return $args; } add_filter( … Read more

Display an authors post on a single page only when they are logged in

Check if a user is logged in using is_logged_in. If a user is logged in modify the query using pre_get_posts filtering posts by the current author ID. if ( is_user_logged_in() ) : function filter_posts_by_author( $query ) { global $current_user; get_currentuserinfo(); $query->set( ‘author’, $current_user->ID ); } add_action( ‘pre_get_posts’, ‘filter_posts_by_author’ ); // … loop else : echo … Read more

Custom page in archive page for certain category

You could use template_include conditionally. add_filter( ‘template_include’, ‘wpsites_photo_page_template’, 99 ); function wpsites_photo_page_template( $template ) { if ( is_category(’33’) ) { $new_template = locate_template( array( ‘photo.php’ ) ); if ( ” != $new_template ) { return $new_template ; } } return $template; }

is_page() and is_page_template() not being differentiated

Your code will never get to the is_page_template() if statement because is_page_template() can only be true when is_page() is also true. It also looks like you’ve got some muddled elseif syntax (I think that’s what you want?) and some generally inefficient code that repeats a lot. I’d do this: <?php if( is_page_template(‘right-sidebar.php’) ) { // … Read more