how do i find my akismet api key for wordpress

Some wordpress developer asked me, how do i find my akismet api key for wordpress, For protect your site from spam comments you need the askimet api key. which is common for jetpack and akismet plugin. WordPress api key is very important for using the wordpress jetpack plugin. For hosted wordpress sites wordpress api key is very important.

how do i find my akismet api key for wordpress

Here I will show you how to get the new wordpress api key.

  • sign in with your WordPress.com credentials (if you not have  wordpress.org account yet then sign up to worpdpress.org
  • Then go to your wordpress site and allow Akismet to connect to your WordPress account
  • click “sign up for a subscription”
  • choose your price plan. Get free plan.
  • be greeted by an “All Done” page and your big API key at the top of the page

Copy your api key and put in your wordpress site for jetpack plugin.

how do i find my akismet api key for wordpress
how do i find my akismet api key for wordpress

wordpress XMLRPC api integration with ruby and rails

Ruby on Rails is really OOPs based framework. I personally love this framework. I worked on this for many years. Many Ruby lovers are looking to integrate the wordpress with Ruby on Rails. I strongly suggest to integrate wordpress with ROR using XMLRPC APIs. Using following code you can easily add the wordpress into Ruby on Rails Project. Use my following steps:

wordpress XMLRPC api integration with ruby and rails

Note: There are so many XMLRPC APIs provided by wordpress. I given the some simple example here.

First setup wordpress. Login to wordpress admin and enable the XMLRPC.
Go to Settings->writing and enable the XMLRPC checkbox.

wordpress XMLRPC api integration with ruby and rails
wordpress XMLRPC api integration with ruby and rails

Now you can fetch the wordpress posts, pages, tags etc.. using XMLRPC.

Following script is written in Ruby.

[viral-lock message=”Solution code is Hidden! It’s Visible for Users who Liked/Shared This article on Facebook or Twitter or Google+. Like or Tweet this article to reveal the content.”]

require 'xmlrpc/client'

# build a post

#Use this for reference - http://codex.wordpress.org/XML-RPC_wp , http://codex.wordpress.org/XML-RPC_WordPress_API

post = {
'post_title'       => 'Post Title',
'post_excerpt'       => 'Post excerpt',
'post_content'       => 'this is Post content'
}

# initialize the connection - Change

connection = XMLRPC::Client.new2('http://www.purabtech.in/wordpress3/xmlrpc.php')  #Replace your wordpress URL

# make the call to publish a new post

#result = connection.call('metaWeblog.getRecentPosts', 1,'admin','123456') // Get Recent 10 Post
#result = connection.call('wp.getPost', 1,'admin','123456',19) // Get Single Post
#result = connection.call('wp.getPage', 1,'admin','123456',1) // Get Single Page
#result = connection.call('wp.getPages', 1,'admin','123456',10) // Get Pages
#result = connection.call('wp.getPosts', 1,'admin','123456') // Get 10 Posts from wordpress
result = connection.call('wp.getPosts', 1,'admin','123456',1000) // Get 10000 Posts from wordpress
#result = connection.call('wp.newPost', 1,'admin','123456',post) //For New Creating the Post

puts result // Printresult
puts result.length // Printresult

[/viral-lock]

If you are facing any issue then write to me.

show posts to only registered users in wordpress

Some people want to show posts to only registered users in wordpress in site. You just need to create category and publish your posts in private category.

How to show posts to only registered users in wordpress

Use the following code in index.php and single.php and page.php file.


$cat_id = get_cat_ID('private');
$args=array(
  'category__not_in' => $cat_id,
  'post_type' => 'post',
  'post_status' => 'publish',
  'posts_per_page' => 5
);

if(!is_user_logged_in()){
    $cat_id = get_cat_ID('private');
   $args=array(
  'category__not_in' => $cat_id,
  'post_type' => 'post',
  'post_status' => 'publish',
  'posts_per_page' => 5
);

} else {
    $cat_id = get_cat_ID('public');
$args=array(
  'category__not_in' => $cat_id,
  'post_type' => 'post',
  'post_status' => 'publish',
  'posts_per_page' => 5
);

}
// The Query
query_posts( $args );

// The Loop
while ( have_posts() ) : the_post();
	echo '<li>';
	the_title();
	echo '</li>';
endwhile;

// Reset Query
wp_reset_query();
How to show posts to only registered users in wordpress
How to show posts to only registered users in wordpress

change Visual Editor Font Size without wordpress plugin

wordpress tutorial for, change Visual Editor Font Size without wordpress plugin. need to open your functions.php file and put following code in that file.

change Visual Editor Font Size without wordpress plugin

change Visual Editor Font Size without wordpress plugin
change Visual Editor Font Size without wordpress plugin

You need to open your functions.php file and put following code in that file.using following code you can change the font size of editor.

Note: If you are not having knowledge of wordpress code and php then dont use  the code.

add_action( ‘admin_print_styles-post.php’, ‘my_admin_css’ ); add_action( ‘admin_print_styles-post-new.php’, ‘my_admin_css’ ); function my_admin_css() { ?&gt; &lt;style type=”text/css”&gt; #editorcontainer textarea#content { font-size: 2em !important } &lt;/style&gt; &lt;?php

 

Display FeedBurner Reader count in wordpress blog

Displaying the feed burner reader count is nice idea for bloggers. This way can show your blog readers to other blog viewers.
For seo purpose displaying the feed burner reader count is very nice.

Display FeedBurner Reader count in wordpress blog

You can your following code in your wordpress theme file.

<?php
$url = file_get_contents('https://feedburner.google.com/api/awareness/1.0/Get
FeedData?uri=YOUR FEED ADDRESS');
$begin = 'circulation="'; $end = '"';
$page = $url;
$parts = explode($begin,$page);
$page = $parts[1];
$parts = explode($end,$page);
$fbcount = $parts[0];
if($fbcount == '') { $fbcount = '0'; }
echo '
<div> '.$fbcount.'  Subscribers</div>';
?>
Display FeedBurner Reader count in wordpress blog
Display FeedBurner Reader count in wordpress blog

how to disable wordpress post revisions

disable wordpress post revisions and increase wordpress performance. For improving the WordPress website or blog performance you need use following method.

WordPress saves the post revisions after every 2 min. That takes so much mysql storage.
To save MySQL storage, some WordPress user will be happy using this method, this method is Disable WordPress Post Revision.

how to disable wordpress post revisions

Why we need disabled this featured?

It’ because WordPress created such as dummy data revision and this one make our table sized increased. And if you have limited space, this is bad idea, and of course disable Post Revision also made your WordPress running faster.

Open your wp-config.php file and put the following code in that file. If you are not wordpress developer then dont use following code. Please consult with any wordpress developer for this code.

/* disable post-revisioning nonsense */
define('WP_POST_REVISIONS', FALSE);

Add Text to RSS in wordpress Post Title

I faced very complex issue when my post get published. That post copied from other sites. Due to some wordpress plugin that is happening. wp-matic and wp-robots wordpress plugins are very bad which are stilling the other site blog and content.

Add Text to RSS in wordpress Post Title

Prevent the coping your content you should use my method. This method will add the additional text in your title so your wordpress posts will became more secure.
If you are wordpress developer then only use following code. Open your functions.php file from your theme and put following code in that file.

    function wordpressapi_rss_title($content) {
    global $wp_query;
    $postid = $wp_query->post->ID;
    $gpost = get_post_meta($postid, 'guest_post', true);
    $spost = get_post_meta($postid, 'sponsored_post', true);

    $content = 'Post by WordPressapi.com - '.$content;

    return $content;
    }
    add_filter('the_title_rss', 'wordpressapi_rss_title');

This code will add the custom text in your title. For more information you can search in my blog
https://purabtech.in

Modify wordpress Custom excerpt length

In wordpress api we having the the_excerpt method for showing the short description from wordpress post.
On WordPress 2.9 there are new featured that we can added on the_excerpt(), one of them is change the excerpt length.

Modify wordpress Custom excerpt length

For Modify wordpress Custom excerpt length we need use the filter for modify the wordpress excerpt length. Use our custom code and put in functions.php file

For changing the length of excerpt we need use the filter for modify the wordpress excerpt length.
We only needed to put some function on our functions.php themes file and added some hook to call this functions.

<?php
// Add custom excerpt length
function custom_excerpt_length($length) {
return 20;
}
add_filter('excerpt_length', 'custom_excerpt_length');
?>

Using above code you can control the character length in wordpress description.

Prevent external requests for your WordPress blog

When you run the wordpress blog there must be many external links would be created by others. which are not good for your blog. Some sites may be only using your wordpress images by your images links.

Prevent external requests for your WordPress

For Prevent external requests for your WordPress blog you need to use simple trick. WordPress api is given this facility to prevent the external request.

To do so, open your wp-config.php file and copy paste the following code:

define('WP_HTTP_BLOCK_EXTERNAL', true);

It will block external requests from that time on. Though, some plugins need the external request to work properly. If you experience problems, you can define a whitelist by pasting the code below into wp-config.php. Don’t forget to replace my url by the one needed by the plugin.

define('WP_ACCESSIBLE_HOSTS', 'purabtech.in');

if you are still having any issue then please contact to me.

how to add a favicon to your wordpress blog

We all know what is favicon logo. WordPress tutorial, how to add a favicon to your wordpress blog. In wordpress theme you can easily add the favicon logo using following code and put in functions.php file

how to add a favicon to your wordpress blog

you just need to open your functions.php file and put following code in that file.

function childtheme_favicon() { ?>
<link rel="shortcut icon" href="<?php echo bloginfo('stylesheet_directory') ?>/images/favicon.png" >
<?php }
add_action('wp_head', 'childtheme_favicon');
how to add a favicon to your wordpress blog
how to add a favicon to your wordpress blog

Note: your favicon.ico file need to placed under theme->images folder. then only this code will work