Tag Info

New answers tagged

1

Before I start, it will be a good idea to check out my answer to the following post What is singular.php? It will give you some more insight As I stated in the linked answer, You can have a fully functional website with just index.php as template to display posts with for all pages What you are doing is fine, and if there are any speed difference, it ...


0

For me, it's perfect to use that sort of IF logic statements in Index than writing new template files. In fact, what you're doing in your example code is already there in themes like TweentyTwelve etc. However, if you see any chance of need for different HTML code structure in future, it's better to keep the template files separate apart. So, give it a ...


0

I managed to solve the problem myself. I had to flush the permalinks on the English admin page. Now all of the above urls work.


0

The JavaScript should be: <script> jQuery( document ).ready(function ( $ ) { $( "#searchform" ).on( "submit", function ( ev ) { ev.preventDefault(); $.post( "<?php echo admin_url( 'admin-ajax.php' ) ?>", { action: "wpa56343_search", ...


0

I think, the problem is that you just put filtered query in $query variable but did not set it in the main query i.e. $query->set() See if this works in your code - $query->set( 'tax_query', $taxquery ); instead of $query = new WP_Query( $taxquery );


-1

Look WP GG Search! It is a powerful plugin to search everything in the backend. It supports also Custom Post types. If you want to expand it there are a few of free plugins. It provides a easy API documentation, look at the page... My feedback to this plugin: it is very easy to use and you safe a lot of time while working with wordpress! Edit (sorry for ...


0

You are abusing pre_get_posts badly with that code. With pre_get_posts the point is to alter the main query. By doing that you reduce the number of necessary queries and save some processing time, plus keep the WordPress globals-- $wp_query, for example-- neat for any other code that might need them. What you are doing is creating new globals and populating ...


1

Just add to your theme this code: <?php get_search_form(); ?> This code will echoing search form so place it everywhere where you want to have the search form. Further you need to have search.php file in your theme which will show the search results. You can use ordinary WP loop in the file.


0

Check if search query is empty ( get_search_query() ), just replace the first IF by that: <?php if (have_posts() && get_search_query()) : while (have_posts()) : the_post(); ?>


2

Not in the url, but you can pass other parameters in the groups loop. There is a search_terms parameter in bp_has_groups(). It also has an orderby parameter that accepts total_member_count as the property. Assuming the tag info is stored in group_meta, you can add a meta_query parameter to the bp_has_groups(). More info from the BuddyPress codex.


0

Assuming you are using post_meta this should help:: $color = 'red'; $the_query = new WP_Query(array( 'meta_key' => 'color', 'meta_value' => $color ));



Top 50 recent answers are included