Quantcast

9 Most Wanted WordPress Tips

WordPress is web software you can use to create a beautiful website or blog on your own. It is a free and open source blogging tool and a content management system based on PHP and MySQL. It includes features like plug-in architecture and template system. It was first released on May 27, 2003 by founders Matt Mullenweg and Milk Little. If you are exciting user of wordpress you need to go through these tips.

9 MOST WANTED WORDPRESS TIPS

1. How to create a page that displays Random posts:-

Have you ever been to a site and saw this feature? It contains a link in their top navigation to something like stumbe! If you give a single click on that link it takes you to a page that displays random page. You need to follow the below trick to create custom page template. Paste this code as it is.

<?php
query posts(array('order by' => 'rand', 'showposts' => 1));
if (have_posts()) :
while (have_posts()) : the_post(); ?>

<h1><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h1>

<?php the_content(); ?>

<?php endwhile;
endif; ?>

It is a wordpress loop which runs a query and displays random posts.

2. Displaying Relative dates in wordpress:-

It is very easy to display relative dates in wordpress.It is one of the nice and pretty tip to implement. For this, you need to download a plug-in called WP-Relative Date. After downloading activate the plugin, then look into your single.php, index.php and page.php for the below code.

<?php the_date(); ?>

Replace it with the below code.

<?php relative_post_the_date(); ?>

3. How to Add E-mail button to your Blog:-

If you want to make your readers to be able to contact you, use any one of the great contact form wordpress plug-in available. This contact forms prevents spammers from finding your e-mail address. It is better to offer “E-mail Address AT Email company DOT com” to avoid spammers. Go to wick creates n e-mail where the reader can enter in someone’s e-mail address and send them a link to your page.

&lt;script type="text/javascript"&gt;
 &lt;!-- Begin
 function isPPC() {
 if (navigator.appVersion.indexOf("PPC") != -1) return true;
 else return false;
 }
 if(isPPC()) {
 document.write('&lt;a class="contact" HREF="<a href="mailto:?subject=Take">mailto:?subject=Take</a>a look at this page I found, ' + document.title + '?body=You can see this page at: ' + window.location + '" onMouseOver="window.status='Send your friends e-mail about this page'; return true" TITLE="Send your friends e-mail about this page"&gt;Email to a Friend&lt;/a&gt;');
 }
 else { document.write('&lt;a class="contact" HREF="<a href="mailto:?body=Take">mailto:?body=Take</a> a look at this page I found titled ' + document.title + '. You can see this page at: ' + window.location + '" onMouseOver="window.status='Send your friends e-mail about this page'; return true" TITLE="Send your friends e-mail about this page" rel="nofollow"&gt;Email This!&lt;/a&gt;');
 }
 // End --&gt;
 &lt;/script&gt;

4. Creating a Mobile Version for you

Creating a mobile version is not that much hard as you think. It does not include any programming. MoFuse helps site owners for creating a mobile version of the website within clicks.

Creating a Mobile Version for you

It is very simple to implement. Just sign up fill up a couple of compulsory text-fields and your mobile site is good to go. Mofuse is free but you intend to get more out of your mobile site.

mobile site

5. How to separate wordpress comments and trackbacks:-

Are you in confusion how to separate wordpress comments and trackbacks? You need to require a minimal amount of coding work to set up.

Follow the below steps.

1. Access your comments.php file and locate the following code.

 .*<?php foreach ($comments as $comment) : ?>

Immediately after the above code, you need to place this code:-

<?php $comment_type = get_comment_type(); ?>
 <?php if($comment_type == 'comment') { ?>

2. Next, scroll down a little bit and locate the following code.

 <?php endforeach; /* end for each comment */ ?>

Immediately before the above code, you need to place this code.

<?php } /* End of is_comment statement */ ?>

This will filter all of trackbacks from your main comments loop.

Now create a second comments loop to display the trackbacks and pingbacks.

3. Immediately below the code from step2 and enter this code.

<?php else : // this is displayed if there are no comments so far ?>

Immediately before the above code you need to place this code.

<h3>Trackbacks</h3>
 <ol>
 <?php foreach ($comments as $comment) : ?>
 <?php $comment_type = get_comment_type(); ?>
 <?php if($comment_type != 'comment') { ?>
 <li><?php comment_author_link() ?></li>
 <?php } ?>
 <?php endforeach; ?>
 </ol>

You can adjust this code to display the way you want including different header.

6. How to highlight author comments in wordpress:-

Do you want to make your own comments with different color to your blog. First you need to check the user id to see if it’s the user id of the blog owner. After that, it is very simple.

1. Changing your theme to add an authcomment style:-

Edit style.css and at the bottom add these lines.

.authcomment {
 background-color: #B3FFCC !important;
 }

2. Editing your comments.php file to add a little code:-

Your comment.php file had a line that will look like this:

<li class=”<?php echo $oddcomment; ?>” id=”comment…

And change it to more or less looks like this:-

<li class=”<?php
 /* Only use the authcomment class from style.css if the user_id is 1 (admin) */
 if (1 == $comment->user_id)
 $oddcomment = “authcomment”;
 echo $oddcomment;
 ?>” id=”comment…

7. How to display retweet button on your site:-

As everyone know that to get more exposure, twitter is best used.

As a blogger you should already be using it for your advantage. To make it easier, place a retweet button, so that they can retweet the article with just only one click.

Add the following code in the template file of your choosing most likely single.php

For large button:-
<script type="text/javascript">
 tweetmeme_source = 'wpbeginner';
 </script>
 <script type="text/javascript"src="http://tweetmeme.com/i/scripts/button.js"> </script>

For compact button:-

<script type='text/javascript'>
 tweetmeme_style = "compact";
 tweetmeme_source = 'wpbeginner';

If you want to get more followers to your account change the source to your twitter account name.

8. How to display guest author’s name via. Custom field:-

Some of the guest authors are one-time only authors. So, there is no chance in creating separate profile for them.

The fantastic way to do this is by using the below code:-

Open single.php in your template and add the following code where you can display the author name.

For large button:-

<?php $author = get_post_meta($post->ID, "guest-author", true);
 if ($author != "") {
 echo $author;
 } else {
 the_author();
 } ?>

This code displays the name or author-function.

9. How to optimize wordpress title:-

This post will cover a quick adjustment that you can make to your title tag to show a more optimal title.

title><?php bloginfo('name'); ?> <?php if ( is_single() ) { ?> » Blog Archive <?php } ?> <?php wp_title(); ?></title>

If you want a more search engine friendly way to display custom title for each page of your blog try this code:-

elseif ( is_category() ) { single_cat_title(); echo ‘ - ‘ ; blogin<title><?php if (is_home () ) { bloginfo(‘name’); }
fo(‘name’); }
elseif (is_single() ) { single_post_title();}
elseif (is_page() ) { single_post_title();}
else { wp_title(‘’,true); } ?></title>

Do you have any more tips to share with us? If so, please share it with us in comments.

About Saikrishna Tipparapu

Saikrishna is a student of Computer Science & Engineering and he is also a part time blogger who also blog at TSKSOFT. Started blogging in 2010 for fun and later its became a profession, helping co-bloggers and sharing the knowledge to everyone from what he learned.

Comments

  1. Helpful tutorial Sai. I love these.

  2. Hey..these are really some nice tips.. I never thought to change my theme settings.. but i think these smaal small things can make a site more attractive. Thanks for the info

  3. Nice Article Bro. These are some rare tips which will be useful in SEO and also Search Engine ranking,

    It is a good tutorial on how we can play with WordPress themes

  4. Hi Sai Krishna, Great WordPress Tips bro. Thanks for Sharing!

  5. Hi Sai Sir

    Great Post… helpful WordPress tips for wordpress beginners.. Thanks For Sharing 🙂

    Mosam

  6. Some really useful tips. I especially liked the points 2 and 6.

  7. Really useful, thanks for sharing 🙂

  8. As more and more people are using WordPress to earn more, problems also arise when people do not know much about how it operates. Posts like this is what people who desire to know more about it should read.

  9. These shortcodes can do the trick but this may also lead to lose of data or website corruption. Why can’t one use plugins?? I use plugins for my blog.

  10. Highlighting Author Comment Tip is really a new thing for me. Thanks for these tips. Actually that’s why I love WordPress.

  11. richpythia says:

    I like the tips on how to create a mobile version. I want my WordPress websites to be accessible also through the use of mobiles.

    Great Blog! Thanks for your tips.

  12. The Digg Digg by the Buffer app team can also help with social sharing.

  13. Dear please tell me how to add guest author box for different authors in Blogger?? I know that this tutorial is only for wordpress users but please help me if you know the solution.

  14. Awesome tips given here in this article thanks for sharing
    have a nice day ahead 😀

Leave a Reply to Narender Chopra@SEO Profiler Cancel reply

*

error: Content is protected !!
Read previous post:
Shopping Online
19 Impressive Tips to Start an Effective E-commerce Website

E-commerce, it is one of the excellent things which make our lives much easier and more pleasing. It plays an...

Close