admin

Website Tutorial

Displaying the Last Post Date in WordPress

To display the date of the last post in WordPress, you can use the get_lastpostdate() function, which retrieves the date and time of the last post in the WordPress database. Here’s how you can display it in your theme files...
Website Tutorial

WordPress displays article page views

When you build your own website using WordPress, if you want to display the page views of each article on the website, you will generally use a WordPress page views plug-in, which can conveniently count the page views of each...
Website Tutorial

How To Add Pagination To WordPress

Step 1: Put the following code into the template function file functions.php of the WordPress theme you are using. function kriesi_pagination($query_string){ global $posts_per_page, $paged; $my_query = new WP_Query($query_string .”&posts_per_page=-1″); $total_posts = $my_query->post_count; if(empty($paged))$paged = 1; $prev = $paged – 1;...
Website Tutorial

Display Related Posts By Tags in WordPress

<ul id=”tags_related”> <?php global $post; $post_tags = wp_get_post_tags($post->ID); if ($post_tags) { foreach ($post_tags as $tag) { $tag_list[] .= $tag->term_id; } $post_tag = $tag_list[ mt_rand(0, count($tag_list) – 1) ]; $args = array( ‘tag__in’ => array($post_tag), ‘category__not_in’ => array(NULL), ‘post__not_in’ => array($post->ID),...