How do I do this?: If custom post type exists, echo it, else do not

No need to be that complex, you can use the has_post_thumbnail function <?php if(has_post_thumbnail()): ?> <a href=”https://wordpress.stackexchange.com/questions/35217/<?php the_permalink(); ?>”><img src=”<?php bloginfo(url); ?><?php echo get_post_meta($post->ID, ‘featured-image-large’, true); ?>” title=”<?php echo get_post_meta($post->ID, ‘featured-image-title’, true); ?>” /></a> <?php endif; ?> et voila! =)

Taxonomy search filters

You could make use of add_query_arg() and remove_query_arg() here. For example http://yourdomain.com/?country=india&institute=pune-university would show results of Pune University in India. You could add s=symbiosis to search in the filtered results too. Basically this url would help you out -> http://codex.wordpress.org/Function_Reference/add_query_arg

Listing parent section in search results

For your custom post types and your blog, you can use get_post_type(). For your About parent page, if the pages only go one level deep, you can check $post->post_parent to see if it’s the about page. Otherwise, you can use get_post_ancestors() and check that array to see if your About page is in it!

Jigoshop search taxonomy

You need to change the query settings before it is run. I’m assuming that you have a search.php page, but if not I’ll tell you where to put the code at the end. In search.php add this to the very top of the file (above the get_header() call) – $args = array( ‘posts_per_page’ => get_option(‘posts_per_page’), … Read more

Strip the + symbol from the_search_query

Personally, when I do things like this I use str_replace() [Link] Using your above example it would be implemented like so: <?php $string = the_search_query(); $res = str_replace(“+”, ” “, $string); echo $res; ?> That will replace any + with a space. Or if you want the &nbsp; use this: <?php $string = the_search_query(); $res … Read more

SQL: Search query to get attachments only of those parents which are published

Well since nobody helped with at first look such an easy problem, i used my way, and if somebody will need it here it is: I used this query: $results = $wpdb->get_results( $wpdb->prepare( “select $wpdb->posts.ID, $wpdb->posts.post_status, $wpdb->posts.post_parent from $wpdb->posts where post_title like ‘%%%s%%’ and (post_type=”albumas” OR post_mime_type=”audio/mpeg”) AND (post_status=”inherit” OR post_status=”publish”) $excludes limit 0,”.$setting->limit, ($setting->search_content … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)