How to access the so called “Posts page”

http://codex.wordpress.org/Settings_Reading_Screen “Posts page – Select in the drop-down box the name of the Page that will now contain your Posts. If you do not select a Page here, your Posts will only be accessible via other navigation features such as category, calendar, or archive links. Even if the selected Page is Password protected, visitors will … Read more

Display DISQUS on homepage

Hook it in from your child themes functions file or add the template tag to a front-page.php file Untested add_action(‘loop_end’,’disqus_front_page_after_loop’); function disqus_front_page_after_loop() { if (is_front_page() && function_exists( ‘comments_template’ ) ) { comments_template(); } } Change the loop_end hook to another WordPress or theme specific hook. If using the template tag, you might want to try … Read more

Country Ways Content Show

This is actually quite easy to do: You will need to install a geolacation plugin that provides methods/functions to identify visitor country. N.B. A plugin only providing shortcodes will not work. The only complicating factor is countries can be named in a variety of ways so 2 character ISO Country Codes have to be used … Read more

Different style for first two (sticky) posts

I think you should add a css class and in your loop, put a $i and let $i run, if $i == 2 then you add the css class attribute to that sticky post. $i = 0; while( have_posts() ): the_post(); $i++; if($i == 2): $css_class=”top-sticky”; else: $css_class=””; endif; endwhile; wp_reset_postdata();

How to display recent posts on home page with title, post date, author and featured image?

The functions you are looking for, are: the_post_thumbnail_url(); // For featured image the_author(); // For author name get_author_posts_url(); // For author link the_date(); // For post’s date So, your code should be something like this: <div class=”cs-post-carousel-layout”> <div class=”cs-container swiper-container”> <div class=”swiper-wrapper”><?php // define query arguments $args = array( ‘posts_per_page’ => 5, // your ‘x’ … Read more

How to filter homepage posts by popularity? [closed]

First thing we need to do is create a function that will detect post views count and store it as a custom field for each post. To do this, paste the following codes in your theme’s functions.php file function wpb_set_post_views($postID) { $count_key = ‘wpb_post_views_count’; $count = get_post_meta($postID, $count_key, true); if($count==”){ $count = 0; delete_post_meta($postID, $count_key); … Read more

What is the advantage of using home.php over index.php for the front page

If you look here [is_home vs is_front_page] you’ll see that is_front_page() is true regardless of what the homepage is set to in the WordPress settings. This means that if you don’t plan on releasing this publicly (i.e. short-run usage) then just having a front-page.php should suffice. is_home() is set based on your blogs page (which … Read more