Tag Info

New answers tagged

1

Before we begin, I must point out the following: You're using a file in your theme to send AJAX requests to, don't do this, there are security implications. Instead, use the WP AJAX API, you'll be able to remove half the code and make it work without having to change the URL everytime your site moves You used query_posts to make your query, this is almost ...


0

So I did a second meta entry so could I refine by the entered data. The changes are as followed: $car_price_from = $_POST['_add_car_price']; //taking the data from the form field. $car_price_to = $_POST['_add_car_price']; add_post_meta ( $postid, 'car_price_from', $car_price_from ); add_post_meta ( $postid, 'car_price_to', $car_price_to ); // Now I have 2 ...


0

add_filter('wpseo_robots', 'yoast_no_home_noindex', 999); function yoast_no_home_noindex($string= "") { if (is_home() || is_front_page()) { $string= "index,follow"; } return $string; } this should be fine i think.. somewhere in your theme functions.php and should do the trick.


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: ...


0

Found out how to do it, I added the following in content.php. I added the second elseif statement and simple put the word Document in there before it displays the title of the page. if ( is_single() ) { the_title( '<h1 class="entry-title">', '</h1>' ); } elseif (get_post_type() == 'attachment' ) { the_title( '<h1 ...


1

You can include the search form in your 404.php file using the get_search_form() function. Using get_sidebar( '404' ); would look for a file called sidebar-404.php and fall back on sidebar.php if needed. get_sidebar()


0

$type = 'bananas'; $args=array( 'post_type' => 'bananas', 'post_status' => 'publish', 'posts_per_page' => -1, 'orderby' => 'meta_value', 'order' => 'ASC', 'meta_key' => '_bananas_size', 'meta_query' => array( array( 'key' => '_bananas_size', 'value' => $_GET['size'], ...


0

OK, So this is somewhat embarrassing and sorry for wasting everyone's time. When I narrowed down that the issue was just with the products post_type I went and checked what version of Woocommerce was being used and found that it was way out of date. After updating all Woocommerce plugins to the latest versions the product search worked. One of the first ...


0

Basically everything query-related is in wp-includes/query.php. Search for the parse_search function in that file and the posts_search and posts_search_orderby filters.


0

if your theme have not search-form.php file then you will create the file and add the custom css there. Because search widget is calling the get_search_form() function. First it will search the search-from.php file from activated theme folder. If there have no file then it will call wp's default search form. See the Codex


1

The problem is that by default WordPress only looks in the title and content field. As you build your pages from multiple pieces of external post types the default query doesn't find those parts. Before we go any further I want you to know that this is going to be quite involved as you need to modify the search query quite a lot. I therefore also can't code ...


1

When you omit the action attribute from the form tag, it defaults to the current URL. Give an explicit URL for the form's action to direct it to a specific URL- <form class="form-inline" role="search" action="<?php echo home_url( '/' ); ?>">


0

I just had the same problem, and solved it using the Participants Database plugin. The pdb_list shortcode supports filters, e.g. [pdb_list filter='state=NY']. You can generate any shortcodes from a PHP script by running a script with the do_shortcode() function, like this: echo do_shortcode('[pdb_list filter='state=NY']'); Now you have all the building ...


0

You should call the_post only inside the loop, or call rewind_posts() before actually starting the loop. sidenote: you are doing it totally wrong. don't reinvent the wheel, look in the codex how to write a theme or use one of the bundled default themes as a base to your theme. No sane person starts to code a theme from zero.


0

When WordPress makes a search it uses the search.php template and if it has not it then it uses the index.php template. You can see the template hierarchy here You should include a search form in the search.php template only when you have not a word searched.


0

Ok i manged to create the solution by finding that LIKE condition can be used in meta query. so here is the final code.. $args=array( 'post_type' => 'tyre', 'post_status' => 'publish', 'tax_query' => array( array( 'taxonomy' => 'tyre-category', 'field' => 'ID', //can be set to ID 'tag' ...


0

In my case I use a custom query so I can just use: $query = new WP_Query(array('post_type' => 'akteur', 'meta_query' => array( 'relation' => 'OR', array('key' => 'wpcf-kurzbeschreibung','compare' => 'LIKE','value' => $suchbegriff), array('key' ...



Top 50 recent answers are included