PHP error after theme update

This type of error generally occurs when the index is not set in the array. You can use the function isset in if like if( isset ( $array[‘focus’] ) && !empty( $array[‘focus’] ) ){ }. This code will first check either the index focus exists in the $array or not. If the index exists then … Read more

Filter Custom Post Type Posts by Taxonomy

You would specify listas as the post_type in the Query arguments. And specify taxolistas along with any terms of the taxolistas taxonomy in a tax_query. $args = array( ‘post_type’ => ‘listas’, ‘tax_query’ => array( array( ‘taxonomy’ => ‘taxolistas’, ‘field’ => ‘slug’, ‘terms’ => array ( ‘taxolistas-term1’, ‘taxolistas-term2’ ) ) ) );

Related Posts: if there is no category use tags

There is no mistake in code it is not working because of just comma mistake use this i have made charges into it. function dtwd_related_posts_shortcode($atts){ extract(shortcode_atts(array( ‘count’=> ‘3’, ‘title’ => ‘More useful tips’, ), $atts)); global $post; $current_cat = get_the_category($post->ID); $current_cat = $current_cat[0]->cat_ID; $this_cat=””; $tag_ids = array(); $tags = get_the_tags($post->ID); if ($tags) { foreach($tags as … Read more

Search result based on URL

You don’t and shouldn’t rely on referrers ( they can be stripped, hidden, or just outright lies ) Instead there are alternatives such as submitting to the post type archive: <form action=”/courses” method=”get”> <input type=”test” name=”s”/> </form> Or bundling query vars as hidden inputs: <form action=”” method=”get”> <input type=”test” name=”s”/> <input type=”hidden” name=”post_type” value=”course” /> … Read more