Display Most popular Posts In WordPress

Blog Archives

Display Most popular Posts In WordPress

Add code in your theme where ever you want the popular 5 posts to be displayed. <ul> <?php $pc = new WP_Query(‘orderby=comment_count&posts_per_page=5’); while ($pc->have_posts()) : $pc->the_post(); ?> <li><a href=”<?php the_permalink(); ?>” title=”<?php the_title(); ?>”><?php the_title(); ?></a> <p>Posted by <strong><?php the_author()

Posted in Blog, Wordpress Tagged with: , , ,

How to get latest article(post) in wordpress.

Get latest 5 post <?php $myposts = get_posts(”); foreach($myposts as $post) : setup_postdata($post); ?> Get featured image of article  <?php the_post_thumbnail(‘medium’); ?> Get post title and its link. <h3><a href=”<?php the_permalink() ?>” title=”<?php the_title_attribute(); ?>”> <?php the_title(); ?></a></h3> Get limit

Posted in Blog, Wordpress Tagged with: , ,

How to upload image in wordpress

  if(isset($_POST[‘submit’])&&$_POST[‘submit’]==’SUBMIT’){ //This is the directory where images will be saved $target = WP_CONTENT_DIR.”/upload/”; you have to create folder name upload in root directory(path: wp-content/upload/..) $target = $target . basename($_FILES[‘photo’][‘name’]); //This gets all the other information from the form //

Posted in Blog, PHP, Wordpress Tagged with: , , ,

WordPress Custom Post Type Code Generator

Default Post Types There are five post types that are readily available to users or internally used by the WordPress installation by default : Post (Post Type: ‘post’) Page (Post Type: ‘page’) Attachment (Post Type: ‘attachment’) Revision (Post Type: ‘revision’)

Posted in Blog, Wordpress Tagged with: , ,

Uderstanding Components, Modules And Plugins

One of our most frequently requested topics for people new to Joomla is an explanation of the difference between components, modules and plugins – so that’s exactly what we’re going to look at here. Components. The text of this article

Posted in Blog, Joomla Tagged with: , ,

How To Get Category Name ,Author Name And Date In WordPress

Get Category : You can get category name by perticular post <?php $categories = get_the_category(); $separator = ‘ ‘; $output = ”; if($categories){ foreach($categories as $category) { $output .= ‘<a href=”‘.get_category_link( $category->term_id ).” . esc_attr( sprintf( __( “” ), $category->name

Posted in Blog, Wordpress Tagged with: , ,

Difference Between excerpt() And Content() function

excerpt The WordPress Excerpt is an optional summary or description of a post in short, a post summary. Html tags doesn’t work eg.<ul>,<li>,<Span>. you can Use of this function in index.php in your theme to post summary. <?php the_excerpt(); ?> content Use

Posted in Blog, Wordpress Tagged with: , ,

Top Plugins In WordPress Used

Theme My Login This plugin themes the WordPress login, registration, forgot password pages according to your current theme. It creates a page to use in place of wp-login.php, using a page template from your theme. Also includes a widget for

Posted in Blog, Wordpress Tagged with: ,