How to add icon over specific thumb

The implementation can be purely CSS, and depends on your specific HTML markup. However, the class you’ll need to target is supplied by the post_class() template tag. Let’s say you have something like the following, basic markup: <div id=”post-<?php the_ID(); ?>” <?php post_class(); ?>> <div class=”post-title”> <img … /> <h1><?php the_title(); ?></h1> </div> <!– Etc. … Read more

Change default post style to columns

There are multiple ways to that but what I like to do is to create shortcodes e.g [one_half] : function one_half_sh( $atts, $content = null ) { return ‘<div class=”one-half”>’ . do_shortcode($content) . ‘</div>’; } add_shortcode( ‘one_half’, ‘one_half_sh’ ); Then the CSS can look like this : .one-half { width: 48%; margin: 0 4% 0 … Read more

WordPress dynamic widget by location?

try to make a simpler code: change $side_bar= “‘$city-Right'”; to $side_bar= $city . ‘-Right’; you have extra ‘ in $side_bar, the way you’ve done would give you ‘Madurai-Right’ but you need Madurai-Right, this way dynamic_sidebar($side_bar) would be like writing dynamic_sidebar(“‘Madurai-Right'”) while you only need dynamic_sidebar(“Madurai-Right”) besides, always avoid variable substitution, concatenation is always more secure.

Why does my URL keep returning 404 error code?

Here is the solution of my problem, thanks to @Milo: function wpa_date_archive_post_types( $query ){ if( $query->is_main_query() && $query->is_date() ): $query->set( ‘post_type’ , array( ‘movie’ ) ); $query->set( ‘year’ , 0 ); $query->set( ‘tag’ , ‘1994’ ); $query->set( ‘post_status’ , array( ‘publish’ ) ); endif; } add_action( ‘pre_get_posts’, ‘wpa_date_archive_post_types’ );

display unique post per category

Track your post IDs. $cat_args = array( ‘orderby’ => ‘name’, ‘order’ => ‘ASC’, ‘exclude’ => ‘17,1’, ‘number’ => ‘6’ ); $fcategories = get_categories($cat_args); $used_ids = array(); foreach($fcategories as $fcategory) { $post_args = array( ‘posts_per_page’ => 1, ‘cat’ => $fcategory->cat_ID ); if (!empty($used_ids)) { $post_args[‘post__not_in’] = $used_ids; } $fposts = new WP_Query($post_args); if ($fposts->have_posts()) { while($fposts->have_posts()) … Read more