How to display custom posts month by month?

wp-query be used to show posts month by month, and have it only show the past year <?php $blogtime = date(‘Y’); $prev_limit_year = $blogtime – 1; $prev_month = ”; $prev_year = ”; $args = array( ‘post_type’ => ‘asian’, ‘posts_per_page’ => 20, ‘ignore_sticky_posts’ => 1 ); $postsbymonth = new WP_Query($args); while($postsbymonth->have_posts()) { $postsbymonth->the_post(); if(get_the_time(‘F’) != $prev_month … Read more How to display custom posts month by month?

What is the difference between “post” and “page” in WordPress?

many people are confused in page and post difference. wordpress  comes  with two content type post and page begineer developer are confused, Pages These are your static pages.  Examples of your pages would be: About, Services, Contact, etc. While the WordPress database stores the published date of the page, pages are timeless entities. For example, your about … Read more What is the difference between “post” and “page” in WordPress?

WordPress Custom Taxonomy With Same Slug As Custom Post Type

If you want the Terms in your Custom Taxonomy to have their URL path containing their Custom Post Type slug instead of Custom Taxonomy slug without showing 404 page, that can be a little tricky, and as I found throughout the blogs and forums quite impossible. create register post type // register custom post type function create_post_types() { register_post_type(‘latestcases’, array( ‘labels’ => array( ‘name’ … Read more WordPress Custom Taxonomy With Same Slug As Custom Post Type

How can add active class for multi-dimensional array of menus.

How can add active class for multi-dimensional array of menus. I am trying to create a menu where a class “active” is assigned to the page whenever following the step by step using php 1) Create a multi-dimensional array of menus. 2) Key is the link and value is the text. 3) Get the current … Read more How can add active class for multi-dimensional array of menus.

How to assign a class “active” to the li click event using jQuery or JavaScript

I am trying to create a menu where a class “active” is assigned to the page whenever it’s selected and loaded and following this using javascript my menu its custom <ul class=”nav navbar-nav”> <li class=”active”><a href=”http://localhost/wp/index.php”>Main</a></li> <li><a href=”http://localhost/wp/news”>News</a></li> <li><a href=”http://localhost/wp/contacts”>Contacts</a></li> </ul> Its working at my end use this <script> jQuery(document).ready(function() { jQuery(“.nav.navbar-nav li”).click(function(){ jQuery(“.nav.navbar-nav li”).removeClass(‘active’); … Read more How to assign a class “active” to the li click event using jQuery or JavaScript

How to Create Custom Post Types in WordPress

Custom post types are one of the more useful features in WordPress. In this article, we will show you how to create custom post types in WordPress. Creating custom post type the Easy way you can create manually  custom post type by adding the required code in your theme’s functions.php file // Our custom post type function function create_posttype() { … Read more How to Create Custom Post Types in WordPress

Submit a Custom Post Type in WordPress from the Front End

To allow users to submit content, you need to provide a form. The form fields will be used to input details, such as title, post content, tags, categories, featured image, etc. For example, you could create the form as follows: <form method=”post”><p><label for=”stackTitle”><?php _e(‘Enter the Post Title:’, ‘mytextdomain’) ?></label> <input type=”text” name=”stackTitle” id=”stackTitle” /></p> <p> … Read more Submit a Custom Post Type in WordPress from the Front End

Basic WordPress Tutorial

WordPress is an open source Content Management System (CMS), which allows the users to build dynamic websites and blog. Since then, WordPress has evolved to the largest self-hosting website creation tool in the world, used on millions of sites and seen by tens of millions of people every day. The fact that you do not … Read more Basic WordPress Tutorial