Skip to main content

Posts

Showing posts with the label How To

How to get random Tags of WordPress?

To get the random tags of WordPress you just need to make a function like below and save it in your themes/child-themes functions.php file. Have a look of below code-- function random_tag_abhinesh(){ $a=get_the_title(); //search the tag by the order of first letter of page title ex- page title is A then the tags which is started from letter A $a = strtolower($a); $tags = get_tags(array( 'hide_empty' => false, 'orderby' =>'count' )); shuffle($tags); foreach ($tags as $tag ) { if(strtolower(substr($tag->name,0,1)) !=$a){ continue; }?> <a class="link-of-tag" href="<?php echo get_tag_link( $tag->term_id ) ?>"> <div class="name-of-tag"><?php echo $tag->name ?></div></a>

How to Enable/ Disable Comments At Once WordPress

Find Posts --> All Posts  Login to your WordPress Admin dashboard. Find Posts --> All Posts Click on the checkbox on header ( In Just Right Panel) that is --> Title Choose Edit under the Bulk Action drop-down and then click APPLY . The bulk edit area will appear (See below Image) Edit under the Bulk Action drop-dow Select the categories   for which you want to enable / disable comments, status, format and others.     Choose the proper action from drop-down ( Bottom right in above image) Click the UPDATE button on the far right That’s all you have to do.