Add Google custom search to wordpress.com [closed]
JavaScript is not allowed on WordPress.com blogs.
JavaScript is not allowed on WordPress.com blogs.
The problem with custom fields is that there is no relation between them so you can’t relate Suburbs to cities. A better way would be to create an hierarchical Custom Taxonomy so you can have a parent – child relation (like categories and sub categories). so: add_action( ‘init’, ‘create_locations_taxonomies’, 0 ); //create two taxonomies, genres … Read more
Somebody on the BuddyPress support forums had this to say: I don’t recommend to change the core files of buddypress. The best way to do it is to write a custom code (I don’t know how to guide you). So if you don’t mind changing the core files, here is a quick way. Open /buddypress/bp-core/bp-core-classes.php … Read more
The default WordPress behavior is to redirect to the Front Page when an empty search query is submitted. What Plugins do you have installed/active? What additions have you made to your .htaccess file?
they’re using CSS3 transitions. <style type=”text/css”> #s { float: right; -webkit-transition-duration: 400ms; -webkit-transition-property: width, background; -webkit-transition-timing-function: ease; -moz-transition-duration: 400ms; -moz-transition-property: width, background; -moz-transition-timing-function: ease; -o-transition-duration: 400ms; -o-transition-property: width, background; -o-transition-timing-function: ease; width: 72px; } #s:focus { background-color: #f9f9f9; width: 196px; } </style> <input type=”text” class=”field” name=”s” id=”s” placeholder=”Search”>
Something like this should work: function my_search_filter($query){ if($query->is_search) $query->set(‘author’, get_current_user_id()); return $query; }; add_filter(‘pre_get_posts’, ‘my_search_filter’);
I have no idea if this will work, but couldn’t you reference the post_parent in the query args? function SearchFilter($query) { if ($query->is_search) { //$query->set(‘post_type’, ‘page’); global $post; $query->set( ‘post_parent’, $post->ID ); } return $query; } add_filter(‘pre_get_posts’,’SearchFilter’); Again, completely untested. I’m not terribly familiar with using $query->set().
Open searchform.php Find this in line 12 and edit Search as you wish placeholder=”<?php esc_attr_e( ‘Search’, ‘twentyeleven’ ); ?>”
<?php $post_type = get_post_type($post); switch ($post_type) { case “type1”: echo “<img src=”https://wordpress.stackexchange.com/questions/35564/label1.png”/>”; break; case “type2”: echo “<img src=”label2.png”/>”; break; } ?>
You should look into meta_query: $args = array( ‘meta_query’ => array( ‘key’ => ‘event_start_timestamp’, // the name of the meta ‘value’ => ’11/21/2011′, // the value to search for ‘compare’ => ‘>=’, //search for start dates bigger or equal to value ) ); $query = new WP_Query( $args );