Category Archives: WordPress

Move Across WordPress Draft, Pending And Publish Post Statuses

Don’t use register_post_status before init. Register Post Status is a function used to create and modify post status based on given parameters. register_post_status() function is located in wp-includes/post.php It accepts following two parameters:

  • $post_status means a string for the post status name
  • $args means an array of arguments

<?php register_post_status( $post_status, $args ); ?>

Example:
(Following example registers “Unread” post status:

function my_custom_post_status(){
register_post_status( ‘unread’, array(
‘label’ => _x( ‘Unread’, ‘post’ ),
‘public’ => true,
‘exclude_from_search’ => false,
‘show_in_admin_all_list’ => true,
‘show_in_admin_status_list’ => true,
‘label_count’ => _n_noop( ‘Unread <span class=”count”>(%s)</span>’, ‘Unread <span class=”count”>(%s)</span>’ ),
) );
}
add_action( ‘init’, ‘my_custom_post_status’ );

Where:

  • label is a descriptive name for the post status marked for translation.
  • public – Set true to show posts of this status in the front end. Defaults to false.
  • exclude_from_search – Set true to exclude posts with this post status in search results. Defaults to false.
  • show_in_admin_all_list – Defines whether to include posts in the edit listing for their post type.
  • show_in_admin_status_list – Shows in the list of statuses with post counts. Example: Published (12)
  • label_count – The text to display on admin screen or you won’t see status count.

Show Related Posts In Your WordPress Blog Without Using Any Plugin

Copy and Paste the given code within the loop. It may engage your blog visitors to stay for a longer time:

<?php
//for use in the loop, list 5 post titles related to first tag on current post
$tags = wp_get_post_tags($post->ID);
if ($tags) {
echo ‘Related Posts’;
$first_tag = $tags[0]->term_id;
$args=array(
‘tag__in’ => array($first_tag),
‘post__not_in’ => array($post->ID),
‘showposts’=>5,
‘caller_get_posts’=>1
);
$my_query = new WP_Query($args);
if( $my_query->have_posts() ) {
while ($my_query->have_posts()) : $my_query->the_post(); ?>
<p><a href=”<?php the_permalink() ?>” rel=”bookmark” title=”Permanent Link to <?php the_title_attribute(); ?>”><?php the_title(); ?></a></p>
<?php
endwhile;
}
}
?>

This code displays posts related to current post. It is based on tags. You may change the number of posts it displays, just change ‘showposts’=>5 with your number.

Display Popular Posts In Your WordPress Blog’s Sidebar Without Using Any Plugin

You can highlight most popular content of your WordPress site in your sidebar. Copy-Paste the following code in your theme’s sidebar.php file:

<h2>Popular Posts</h2>
<ul>
<?php $result = $wpdb->get_results(“SELECT comment_count,ID,post_title
FROM $wpdb->posts ORDER BY comment_count DESC LIMIT 0 , 5″);
foreach ($result as $post) {
setup_postdata($post);
$postid = $post->ID;
$title = $post->post_title;
$commentcount = $post->comment_count;
if ($commentcount != 0) { ?>
<li><a href=”<?php echo get_permalink($postid); ?>” title=”<?php echo
$title ?>”>
<?php echo $title ?></a> {<?php echo $commentcount ?>}</li>
<?php } } ?>
</ul>

It displays most popular posts on your site’s sidebar.

For changing the number of posts to display in your sidebar:

Look-up for this line in the above code block: FROM $wpdb->posts ORDER BY comment_count DESC LIMIT 0 , 5″); and Replace 5 with the number of posts you like to display.

Easiest Way for Displaying both Popular and Unpopular Posts in your Sidebar:

Now easiest way to do this (display popular posts) and many other similar things like displaying both popular and unpopular posts, knowing the number of post hits is to use Most and Least Read Posts Widget Plugin

Download from the link, activate it and start using it by placing its widgets in your sidebar. It gives you two different widgets one shows most read posts and the other shows least read posts and also it counts your post hits both on sidebar and in your dashboard All Posts list.

Hide Post Images Without Removing Thumbnail Image In Category Archive

Given code hides post images but keeps thumbnail image in Category archive and homepage. Add following code block in your theme’s function.php:

function wpi_image_content_filter($content){

if (is_home() || is_front_page() || is_category()){
$content = preg_replace(“/<img[^>]+>/i”, “”, $content);
}

return $content;
}
add_filter(‘the_content’,’wpi_image_content_filter’,11);

WordPress’s VIP Team Launched New Plugin That Controls Bulk User Management On Multisite Network

VIP team launched new plugin which is capable enough to control and manage all users across many sites in a multisite network install. It can check all network users and their roles on different sites sites and helps you to edit users, user roles on different sites at a time without visiting their dashboard from All Sites Super Admin Menu.

Your WordPress P2 Blog Can Now Be A Full-Blown Issue Tracker

You can now have your WordPress blog as a full-blown issue tracker with Recently updated Resolved/Unresolved Posts Plugin. Test it live here in this post. Check Resolved/Unresolved button at the top right corner of this post.

  • Green posts are resolved issues.
  • Red posts are unresolved issues.

You also get a sidebar widget for quick overview of resolved and unresolved posts.

Source: http://kovshenin.com/2012/wordpress-as-an-issue-tracker/

10 Android Apps That Bloggers Should Have

1. WordPress

WordPress App for Android is available at Google Play Store. Using this App bloggers can maintain their blogs from their Android Device. This App is useful for both self-hosted blogs and blogs hosted on wordpress.com

Download WordPress App

2. Tumblr

If you maintain a Tumblr micro-blog then you should try this App. Using this app you can post content, read and write messages, schedule post activity, manage multiple Tumblr blogs and view contacts of Tumblr blogs in your address book etc.

Download Tumblr App

3. Google Drive

It helps you to store all kinds of documents, audio, video, images, pdf etc in cloud and also sync all documents across multiple devices connected to your Google account.

Download Google Drive App for Android

4. Blogger

Try this App if you blog on Blogger. Functionality of this app is still very limited as compared to the WordPress App.

Download Blogger App

5. Writer

Writer is a simple text processor that provides you distraction-free writing environment on your smartphone which is very useful while writing long posts.

Download Writer App

6. Disqus

Disqus commenting system for WordPress is getting very popular these days because its integrated community features brings people back and keep them engaged. Using this App you can access all commenting features of you blog from your smartphone.

 Download Disqus App

7. Tape A Talk

Tape A Talk is a voice recorder App. Bloggers use this App for recording interviews etc. This App can upload audio-recording to many online services and blogs.

Download Tape-A-Talk App

8. GAnalytics

GAnalytics is mobile version of Google’s famous service ‘Google Analytics’. This App gives a good account of your blog traffic, usage statistics and bounce rates etc.

Download GAnalytics App

9. Flipboard

Flipboard allows you to open Facebook, Twitter and Google+ streams. Using this App you can browse your blog’s Facebook Page, social news, comments etc

Download Flipboard App

10. Photo Editor

Using this App you can crop, edit, resize, add effects, texts and drawings to your photos before posting them to your blog.

Download Photo Editor

Embed Flickr & Picasa Photostreams In Web Pages As A Flash Slideshow

Use PictoBrowser for embedding your Flickr – Picasa Photos in your website.

What is a PictoBrowser?

PictoBrowser a free web application that displays Flickr and Picasa images on websites and blogs.

How to get a PictoBrowser?

  1. Visit here
  2. If this link doesn’t work then visit http://pictobrowser.com/
  3. Click PictoBuilder at the top left corner of the page.
  4. Enter your Flickr/Picasa username.
  5. Choose images.
  6. Set Tag or Groups.
  7. It outputs some HTML code
  8. Copy that HTML code and paste it in your website or blog.
  9. If you use WordPress then you may paste it inside your posts and pages.

Adding JavaScript Inside Your WordPress Posts

While writing any post change mode from Visual to HTML and paste your javascript there.

Excluding this there are many plugins available which allows you to add javascript in WordPress posts.

You may try this plugin also Custom fields shortcode. Although this plugin hasn’t been updated in over 2 years but it works good without  showing any error in my blog.

Useage:

Use [cf] shortcode in your post content to show the custom field value without editing any of your WordPress theme files.

For Example:  [cf] FieldName[/cf] returns value of ‘FieldName’ custom-filed.

Check similar plugins here.

Creating WordPress Multisite Network

    • Install WordPress
    • Add the following line just above /* That’s all, stop editing! Happy blogging. */
    • define(‘WP_ALLOW_MULTISITE’, true);
    • Last step enables the Network Setup item in your Tools menu.
    • Go to Dashboard => Tools => Network Setup.
    • Do as directed. It will ask you to choose from the following two network options:
  • Sub-domains — a sub-domain based network in which sub-sites use subdomains. Example: http://lamp.sangkrit.net
  • Sub-directories — a path-based network in which sub-sites use directory path. Example: https://sangkrit.net/lamp
    • If you choose sub-domain network option then you will need to generate wild card from your c-panel check this tutorial: Subdomain Network: Adding A Wild-Card DNS In DNS Server
    • Network details get filled in automatically but you are free to make changes:
  • Server Address: The domain of the URL to access your WordPress installation.
  • Network Title: The title of your multisite network.
  • Admin E-mail:  Super admin’s email address for whole network.
  • Click the Install button.
  • Follow on screen instructions.  It provides you with cold blocks to add on your site’s wp-config.php and .htaccess files and prompts you to create a directory:
  • Create a directory for media file uploads. Directory should be writable by webserver.
  • Add the specified lines to your wp-config.php file
  • Add the specified lines to your .htaccess file
    If you do not have a .htaccess file, then create it in root directory.
  • Clear your browser’s cache and login to your site.
  • From your Dashboard at the top left corner you will see My Sites menu. Now you may visit your Network Administration from My Sites => Network Admin => Dashboard.

Migrating Multiple Blogs To WordPress Multisite

  • Export content of your existing WordPress installations from Dashboard=> Tools=> Export
  • Install WordPress
  • Activate Multisite by adding define(‘WP_ALLOW_MULTISITE’, true); in your wp-config.php
  • Open Dashboard of your new WordPress installation.
  • Open Tool=> Network Setup from Dashboard and do as directed.
  • Create blog for each site you like to import.
  • Import each site’s content you exported from old installations from Dashboard=> Tools=> Import
  • Install all themes and plugins of your old site if you like and network activate them.
  • If your old installations have their own domain names then Map domains to your main site using MU Domain Mapping

Embedding RSS Feed In Your WordPress Posts And Pages

Open Your themes function.php and add the following code at the bottom:

include_once(ABSPATH.WPINC.’/rss.php’);

function readRss($atts) {
extract(shortcode_atts(array(
“feed” => ‘http://‘,
“num” => ‘1’,
), $atts));

return wp_rss($feed, $num);
}

add_shortcode(‘rss’, ‘readRss’);

Save function.php and whenever you need to embed RSS in any of your post or page write the following short code inside your post:

[ rss feed=”https://sangkrit.net/feed” num=”5″ ]

In the above give short code replace https://sangkrit.net/feed with your feed address and in num=5 replace 5 with the number of posts you like to show.

Note: Remember there is no space between [ and rss feed and num=”5″  and  so after you copy the short code; check the space, remove it (if there is some space) and then publish it.

Tips For Successful WordPress Site Submission To Search Engine

  1. You can submit your site to search engines through many resources. You may do so manually. Whatever method you choose search engine welcomes the site if your content is good.
  2. Search engine scans all content whenever a site is submitted. So be sure about content, it should be there in your site.
  3. Your site should have at least 9 posts so that search engine can get something to examine and evaluate.
  4. Never submit your site to same search engine more than once a month. Never let a search engine note your anxiousness.
  5. Always be ready to copy-paste or write a brief description of your site in about 200 words.
  6. Submit those categories that belong to search engine’s directory.
  7. Keep a list of your website’s various “addresses/URLs” .
  8. You can submit your site’s root directory,  various categories and feeds to search engines. This expands your search coverage.
  9. Keep a track of what you have submitted and when to avoid random re submission.

WordPress Blogging From Android, iOS, BlackBerry, Nokia, WebOS

Making your website’s theme mobile compatible or installing any mobile theme for your WordPress site is good but you can also choose from different mobile apps available for WordPress blogging through smartphone.

WordPress for Android

You can use this for publishing new posts to your blog, responding to comments, getting notified and much more from you Android machine.

Website | Download

WordPress for iOS

iOS app lets you write posts, upload photos, edit pages, and manage comments on your blog from your iPhone, iPad, or iPod touch.

Website | Download

WordPress for BlackBerry

Post to your WordPress blog from your BlackBerry. Manage comments and media, upload videos and more with this BlackBerry native app.

Website | Download

WordPress for Nokia

Nokia app allows you to edit your existing blog content, add new posts and pages, manage comments, and more — directly from your S60 or Maemo-powered Nokia device.

Website | Download

WordPress for WebOS

WebOS represents a different way to blog. It uses Sliding Panels that makes managing existing content on your blog intuitive and powerful.  You can use visual editor for posting content to your blog.

Website | Download

How Automattic Makes Money

WordPress is Free, Opensource and Priceless software from Automattic used for creating website, blog or something like that. You can download WordPress from www.wordpress.org for free.

But you know how Automattic makes money as it gives everything for free. No, it don’t give everything for free but yes most of its applications and the core software WordPress is absolute free for you.

Now lets see how WordPress makes money:-

VIP Hosting

WordPress provides VIP Hosting for major brands like Time Magazine, NewYork Times, CNNBoing Boing and also TechCrunch etc. To know more brands hosted on WordPress VIP Hosting CLICK HERE

WordPress offers you two types of VIP hosting:-

Akismet Anti-Spam Technology

Akismet is an automated spam killer used by millions of blogs. Using this you don’t need to spend long time on deleting spam. WordPress makes money through Akismet as it offers different plans to bloggers for use Akismet.

For using Akismet you have to signup by choosing one of the following plans to get an API key:

  • Enterprise: Costs $50/month. Here you get multiple site access. It is good for companies having low web traffic.
  • Pro: Costs $5/month. It gives single site access. Good for small non-personal sites and blogs.
  • Personal:  Costs $0 to $120/year. Good for non-business personal blogs.
  • High Volume: Companies with or over 100k calls per month pays per call. Costs $100/month minute.

Premium Features

These are the optional priced per year upgrades offered by WordPress:

  • Be the master of your domain: Costs: $13.00 – $25.00/year. For controlling your online identity you may add your own domain name. Like www.example.com instead of www.example.wordpress.com This feature can be added to you existing WordPress blog.
  • Extra Storage: Costs $20.00 – $290.00/year. This is used by the bloggers whose content is running out of space.
  • Custom Design: Costs $30.00/year. Bloggers use this to customize blog’s fonts with a point-and-click interface. No coding required.
  • VideoPress: Costs: $60.00/year. Uploads your videos, get them converted into different formats including HD etc. Including many more features.
  • Go Ad-Free: Costs $30.00/year. Time to Time WordPress displays Ads on your blog for logged out users. You may turn off the Ads by using this feature.
  • Guided Transfer: Costs $129.00 . This feature is used for transferring a WordPress site.
  • Premium Themes: You may upgrade to premium WP Themes for adding more options to site customization. Pricing for each theme is displayed under the theme on your dashboard.

Google AdSense 

This is what most of us use to make money online by putting Google Adsense on our web content. This is a free program by Google that empowers online publishers to earn revenue by displaying some Ads on their content. As I had already told you that time to time WordPress displays Ads on your blog for logged out users, this is what Google Adsense.

Support Networks

If support forums aren’t enough to solve your problem then you may switch to support networks.

VaultPress

This is WordPress’s security, backup and support. It backup you blog automatically without any security flaw.

Plans and Pricing follows:

  • Basic: Costs $15/Month per site. Gives realtime backup and automatic restore during disaster.
  • Premium: Costs $40/Month per site. Gives back-up restore and continuous security scan.
  • Enterprise: Costs $350/Month per site. Gives solutions for large scale WordPress Installations.

Poll Daddy

This is Online Survey Software with both free and paid plans as follows:

  • Free: This is absolute free for ever not a trial or something like that.
  • Professional: Costs $200/Year.
  • Corporate: Costs $899/Year