Exclude featured image from attachment loop

Try to use that set of arguments : $args = array( ‘post_type’ => ‘attachment’, ‘post_mime_type’ => ‘image’, ‘numberposts’ => -1, ‘post_parent’ => $post->ID, ‘orderby’ => ‘menu_order’, ‘order’ => ‘asc’, ‘post__not_in’ => array( $thumb_id ) ); I’m using it for one of my site and it’s working fine. So you shouldn’t have to use : if … Read more

Exclude Posts From Specific Category from Next and Previous post links

Use the 4th parameter $excluded_terms http://codex.wordpress.org/Function_Reference/next_post_link <?php next_post_link( $format, $next, $in_same_term = true, $excluded_terms=”402″, $taxonomy = ‘category’ ); ?> Same for the previous_post_link http://codex.wordpress.org/Template_Tags/previous_post_link $previous=”<span class=”meta-nav”>Previous Post</span>”; $next=”<span class=”meta-nav”>Next Post</span>”; <?php previous_post_link( $format, $previous, $in_same_term = true, $excluded_terms=”402″, $taxonomy = ‘category’ ); ?> Or you could create a template tag like whats included in Twenty … Read more

I need to create a search form that will display search results from specific category

You can use WP_query() to narrow down the results of your search: <?php $args = array( ‘s’ => $_GET[‘s’], ‘post_type’ => array( ‘post’, ‘page’ ), ‘post_status’ => ‘publish’, ‘category_name’ => ‘music’, ‘posts_per_page’ => -1 ); $custom_search = new WP_Query( $args ); if ( $custom_search->have_posts() ) { while ( $custom_search->have_posts() ) : $custom_search->the_post(); ?> <div class=”entry-content”> … Read more

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