stuck with template hierarchy
I found a solution by changing my categories.php to category-slug.php and then putting the standard loop back into the the category.php file. All seems good now.
I found a solution by changing my categories.php to category-slug.php and then putting the standard loop back into the the category.php file. All seems good now.
So far as I know there is no ‘last posted on’ value saved for a user. You can find that information by referencing the post_date in the *_posts table against the author data in *_users and *_usermeta. With that in mind I can think of several solutions. First Solution: Pull your authors. You need this … Read more
Try reviewing this page on the codex. Using your above template, I would suggest the following: <?php if ( is_user_logged_in() ) : $args = array( ‘posts_per_page’ => ‘5’, ‘author’ => get_current_user_id(), // Removes a few lines of code 😉 ); $author_posts = new WP_Query( $args ); ?> <?php /* Author has posts? */ ?> <?php … Read more
you can get the category ID of a category archive with: get_query_var(‘cat’)
The problem was in my the loop.php file, i was executing a new loop using the wordpress parameters for the main loop, which caused a duplication with the plugin being used (thecartpress) which executes its own loop. I was using: global $post, $query_string, $discTheme; query_posts($query_string); in a sense, with thecartpresses own loop, I was duplicating … Read more
Only the page post type can have a template assigned (of the default post types), it’s the custom template you set in the Page Attributes meta box. If you have a page.php template file, your index.php will only be used to display post post types, so those posts will never have a _wp_page_template meta key. … Read more
Your theme uses a custom function to get the first image, if you post your index.php codes here you maybe find someone to help.
After some research, I came up with a solution that worked for me. It’s nice because it’s not using the WP Gallery (you don’t need to insert a gallery into your post/page to make it work). It’s awesome because you can do whatever you want inside the “images loop”. Note: the ‘preview’ in $size=”preview” is … Read more
I ended up creating two loops and utilizing anchors. I’m not sure if it’s the most efficient way of doing things, however, it works. add_action( ‘genesis_post_content’, ‘child_do_content’ ); // Adds your custom page code/content function child_do_content() {?> <ul class=”multicol”> <?php $custom_query = new WP_Query(array(‘orderby’ => ‘title’, ‘order’ => ‘ASC’,’cat=5′)); while($custom_query->have_posts()) : $custom_query->the_post();?> <li><a href=”#<?php the_title(); … Read more
Firstly, use WP_query instead of query_posts: Secondly, for (static) pages use the variable ‘page’ (not ‘paged’). $my_query = new WP_query( ‘post_type=post&posts_per_page=5&paged=’ .get_query_var(‘page’) ); if ( $my_query->have_posts() ) while( $my_query->have_posts() ) : $my_query->the_post(); the_title(); endwhile;