Display Categories in a Drop Down Menu

Some blogs have a lot of categories which they can’t display in their sidebar. Or some bloggers do not want to take up a lot of space displaying categories. This option allows them to have a select menu, dropdown menu, for categories. See WordPress Codex for details.

<form action="<?php bloginfo('url'); ?>/" method="get">
$select = wp_dropdown_categories('show_option_none=Select Category&show_count=1&orderby=name&echo=0&selected=6');
$select = preg_replace("#<select([^>]*)>#", "<select$1 onchange='return this.form.submit()'>", $select);
echo $select;
<noscript><input type="submit" value="View" /></noscript>

Disable HTML in WordPress Comments

Did you ever see in your SPAM folder, how many comments have tons of HTML codes which is basically links. That is how most spammers add links. But you can disable HTML in WordPress Comments to be functional. So if someone uses the strong code, it will not bold the text etc.

All you have to do is simply open your functions.php and add the following code:

// This will occur when the comment is posted
function plc_comment_post( $incoming_comment ) {

// convert everything in a comment to display literally
$incoming_comment['comment_content'] = htmlspecialchars($incoming_comment['comment_content']);

// the one exception is single quotes, which cannot be #039; because WordPress marks it as spam
$incoming_comment['comment_content'] = str_replace( "'", '&apos;', $incoming_comment['comment_content'] );

return( $incoming_comment );

// This will occur before a comment is displayed
function plc_comment_display( $comment_to_display ) {

// Put the single quotes back in
$comment_to_display = str_replace( '&apos;', "'", $comment_to_display );

return $comment_to_display;

Source – The original author also offers a plugin that you can download from his site.

How to Create a Custom Login Page in WordPress

Download and install the plugin called Custom Admin Branding.

Browse the following directory to download Admin panel PSD template to guide you while designing :


Then upload your images in this folder or simply replace the current ones. Remember to make your header and footer images in the .png format while your other login images should be in .jpg format:


Once uploaded you are done.

Another plugin that does the same job is called BM Custom Login

For those users who are looking to avoid using the plugin then try this method shared by Michael from Problogdesign which is also a great substitute.


How to Display Relative Dates in WordPress

posted on June 30th 2013 (10 minutes ago)

Have you ever seen this in blog posts and comments and wondered how did this blogger manage to do this? Actually it is pretty easy.

You would need to download a plugin called WP-Relative Date

Once you have downloaded and activated the plugin, look in your single.php, index.php, and page.php for this code:

<?php the_date(); ?>

Replace it with:

<?php relative_post_the_date(); ?>

How to Create a Page that Displays Random Posts

Have you ever been to a site and saw this cool feature? They have a link in their top navigation to something like Stumbe! or Read Random Articles, or some other creative text. When you click on that link, it takes you to a page that displays one random page. Each time you refresh, you are delivered with a new post. Well this trick is just for you then.
create a custom page template. And simply paste this code in there:

query_posts(array('orderby' => '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; ?>

Now create new page and your page name from right side
This is a simple WordPress Loop that is running a query to display random posts and the number 1 in there is telling WordPress to only show 1 post. You can change that number, but most of the time people do it one post a time.

PHP tutorial step1

At first download and install server software.Like XAMPP , WAMP .I would like to teach you in XAMPP serve.when it will install complete .you can see a control panel Like below picture.

Start Apache and MySQL and if you want test your mail send option then you need to start Mercury.
Now you need to go server folder Click Explore on your XAMPP control panel.

Download Netbeans for only php.install your pc and open.

Go to File->New project->php application->name of your project and select your htdocs folder..and finish.


echo ‘Hello world’;


below picture write here you can write any notepad or any text editor when you save your php code save it .php mode..

Like index.php  and save it your htdocs folder.

Thank you.