Pagination problem with multiple loops on the same page
you might wanna try wp_reset_query(); at the end of your loops
you might wanna try wp_reset_query(); at the end of your loops
If the element that is being assigned the “click” event is “#social_trigger”, you cannot have more than one of these elements per page. You are searching for an “id” of an element and by definition, you can only have one element of a particular id per page. You should change your elements to have a … Read more
If you don’t want normal shortcode mechanics (seems like it to me from your description) why bother adding them to content at all? Create couple of specialized meta boxes and you won’t have to deal with scanning and filters at all, just store/retrieve info that you need separately to/from custom fields.
You should be able to do this with just having the front page show blog posts like it does by default. No need to make empty pages and redirect and all that. In the theme file that contains your navigation (quite likely header.php), look for something that looks like this: <ul> <?php wp_list_pages( /* maybe … Read more
Let’s throw everything, but loop out: if ($my_query->have_posts()) { // open container around all posts while ($my_query->have_posts()) : $my_query->the_post(); // output for every post endwhile; // close containers around all posts } As you see: output of posts goes inside while loop as usual; opening larger containers is between checking if we have posts and … Read more
In the Twenty Ten theme they are using a file called loop.php. It defines the loop for different page templates and defines theme accordingly inside loop.php. That’s what allows them to use get_template_part. Depending on your theme and how it’s set up will determine how to go what your asking. If all of your pages … Read more
To get post info outside the regular loop, you can use WP Query Reference In your example you can try something like; $firstsentance = new WP_Query(); $firstsentance->query(‘posts_per_page=-1′); // add additional query parameters as needed, this will query all posts $old_content = the_content()’; //do your php stuff here endwhile;
Try to use the has_post_thumbnail function. From the codex: <?php //This must be in one loop if(has_post_thumbnail()) { the_post_thumbnail(); } else { echo ‘<img src=”‘.get_bloginfo(“template_url”).’/images/img-default.png” />’; } ?>
Before the loop starts use query_posts. Available parameters are here. Something like this: global $wp_query; query_posts( array( ‘post_type’ => ‘mycustomname’, ‘tax_query’ => array( ‘relation’ => ‘AND’, array( ‘taxonomy’ => ‘mytaxonomyname’, ‘field’ => ‘slug’, ‘terms’ => array( ‘myterm1slug’, ‘myterm2slug’ ) ) ) ) );
If you’re using WP_Query, then assign that page a custom meta key ‘home_content’ with a value as 1. Then use WP_Query’s custom field parameters to loop over it. If you can restrict the title as ‘About’ everywhere, use get_page_by_title, and if you can restrict the slug as ‘about’, use get_page_by_path. These methods will work dynamically.