Tag Info

New answers tagged

0

As already stated, you should never (my emphasis) use query_posts to construct custom queries. Note: This function isn't meant to be used by plugins or themes. As explained later, there are better, more performant options to alter the main query. query_posts() is overly simplistic and problematic way to modify main query of a page by replacing it with ...


1

So after much trial and error, I managed to solve the problem. Here's the final code (an adaptation of the one in the question): <?php $sticky = new WP_Query(array ('showposts' => '1', 'cat' => '-11')); if ($sticky->have_posts()) : $stickyid = array(); while ($sticky->have_posts()) : $sticky->the_post(); $stickyid[] = $post->ID; ...


0

I'll put my money to it and say it has something to do with this line 'eventDisplay' => 'all', Can't make sense of what this line actually do. I would just remove it. Also, just a tip, do not use hyphens (-) in taxonomy or custom post type names. They will definitely be troublesome if it comes to custom templates. If you must, use an underscore (_) ...


0

Search Terms Dotifier: Here's one idea using the request filter to append "dotted" words of two or three characters that don't contain any dots, to the current search terms. So if your search string is for example: The LA Dreams it will become: The LA Dreams L.A. Here's a demo plugin to modify the default search: <?php /** * Plugin Name: ...


1

Your problem is your query, but before I cover that, there are some concerns that are getting in the way of seeing the problem. Firstly, every single line has . It's like hanging up and dialling the number again at the end of every sentence in a telephone conversation, and it's so much more effort to type and read. So lets fix that: <?php $query = new ...



Top 50 recent answers are included