How to use category wise background images in wordpress

WordPress has category feature, We can use the wordpress category for many purpose. Given plugins list to use category wise background images in wordpress.

Some time we want use category images for show the category content. Some time we want use the category wise background images in your website.

How to use category wise background images in wordpress

For category images you can use the some nice wordpress plugins.

The Categories Images Plugin allow you to add image with category or taxonomy.

Using this plugin, you can add icons (images) to sidebar of your site or blog into section of categories and pages.

For category background images you need know about body_class() method. Detailed information you can find on following page.

Body_class()

If you have wpapi category then you can use following CSS.

  • If they are there, you can use these as selectors in your CSS: body.category-wpapi { /* code here */ }, etc.
  • If not, add the body_class() function to the tag in your theme, probably located in header.php. It works like this:
    <body <?php body_class(); ?>>
How to use category wise background images in wordpress
How to use category wise background images in wordpress

How to save metadata in wordpress custom post type

Custom post type are very important in wordpress. Code for save metadata in wordpress custom post type. There are some plugins for creating the post type but I recommend custom code in function.php file.

How to save metadata in wordpress custom post type

I already written about custom post type. If you want to know about custom post type in detail then you can use following articles.

Here in this tutorial I showed How to save the meta data for your custom post type.

add_action( 'add_meta_boxes', 'job_detail_box' );

function job_detail_box() {
add_meta_box(
'job_detail_box',
__( 'job Detail', 'myplugin_textdomain' ),
'job_detail_box_content',
'job',
'normal',
'high'
);
}

function job_detail_box_content( $post ) {
// No need to globalise a post that is an argument on this callback
$meta_p = get_post_meta($post->ID, "jobs_price", true);
$meta_l = get_post_meta($post->ID, "jobs_location", true);

echo '<input type="hidden" name="jobs-nonce" id="jobs-nonce" value="' . wp_create_nonce( 'jobs-nonce' ) . '" />';

?>
<div>
<ul>

<ul>

<ul>
	<li><label>job Price</label>php echo $meta_p; ?>" /></li>
</ul>

</ul>

<ul>

<ul>
	<li><label>job Location</label>php echo $meta_l; ?>" /></li>
</ul>

</ul>

</ul>
</div>
<!--?<span class="hiddenSpellError" pre="" data-mce-bogus="1"-->php
}

add_action ('save_post', 'save_jobs');

// The save_post hook provides the post id to the return function
function save_jobs( $post_id ){

if ( !wp_verify_nonce( $_POST['jobs-nonce'], 'jobs-nonce' )) {
return $post_id;
}

if ( !current_user_can( 'edit_post', $post_id ))
return $post_id;

update_post_meta($post_id, "jobs_price", $POST['jobs_price'] );
update_post_meta($post_id, "jobs_location", $POST['jobs_location'] );
}

How to save the meta data in wordpress custom post type
How to save the meta data in wordpress custom post type

	

how to stop wordpress spam comments and increase SEO

WordPress tutorial, how to stop wordpress spam comments and increase SEO. Spam comments is really major issue. Spam comments will affect your site SEO.
You should delete the spam word comments from wordpress site.

how to stop wordpress spam comments and increase SEO

If you want to prevent spam comments wordpress.  You can check more points and wordpress plugins which will be helpful for wordpress websites.

If you have approved spam comments already than you can use following SQL query to change some spam comments status.

Using following sql query you can unapprove spam comments which are already approved.


Update wp_comments set comment_approved=0 WHERE CHAR_LENGTH(comment_author_url)>35;
Update wp_comments set comment_approved=0 WHERE CHAR_LENGTH(comment_author)>30;

 

After this, you can again recheck the comments which might be spam.

For SEO of your site deleting spam word comments is good.

Here are some steps for protecting your wordpress site.

You may copy and paste the following list to the Comment Moderation box in your wp-admin/options-discussions.php page:

  • -online
  • 4u
  • adipex
  • advicer
  • baccarrat
  • blackjack
  • bllogspot
  • booker
  • byob
  • car-rental-e-site
  • car-rentals-e-site
  • carisoprodol
  • casino
  • casinos
  • chatroom
  • cialis
  • coolcoolhu
  • coolhu
  • credit-card-debt
  • credit-report-4u
  • cwas
  • cyclen
  • cyclobenzaprine
  • dating-e-site
  • day-trading
  • debt-consolidation
  • debt-consolidation-consultant
  • discreetordering
  • duty-free
  • dutyfree
  • equityloans
  • fioricet
  • flowers-leading-site
  • freenet-shopping
  • freenet
  • gambling-
  • hair-loss
  • health-insurancedeals-4u
  • homeequityloans
  • homefinance
  • holdem
  • holdempoker
  • holdemsoftware
  • holdemtexasturbowilson
  • hotel-dealse-site
  • hotele-site
  • hotelse-site
  • incest
  • insurance-quotesdeals-4u
  • insurancedeals-4u
  • jrcreations
  • levitra
  • macinstruct
  • mortgage-4-u
  • mortgagequotes
  • online-gambling
  • onlinegambling-4u
  • ottawavalleyag
  • ownsthis
  • palm-texas-holdem-game
  • paxil
  • penis
  • pharmacy
  • phentermine
  • poker-chip
  • poze
  • pussy
  • rental-car-e-site
  • ringtones
  • roulette
  • shemale
  • shoes
  • slot-machine
  • texas-holdem
  • thorcarlson
  • top-site
  • top-e-site
  • tramadol
  • trim-spa
  • ultram
  • valeofglamorganconservatives
  • viagra
  • vioxx
  • xanax
  • zolus

There are some nice plugins also which is helpful for protecting your site from spam comments.
You should activate the Akismet wordpress plugin.
Akismet is quite possibly the best way in the world to protect your blog from comment and trackback spam. It keeps your site protected from spam even while you sleep.

You should check the following option from wordpress:

Before a comment appears: (Options)

  1. Before a comment appears An administrator must always approve the comment
  2. Comment author must have a previously approved comment

If you have many spam word comments in your site then you should use sql query for delete the spam comments.

DELETE FROM wp_comments WHERE comment_content LIKE '%<a%';
DELETE FROM wp_comments WHERE comment_author LIKE '%<a%';
DELETE FROM wp_comments WHERE comment_author_url LIKE '%health%';

You should replace the spam comments words in SQL query. Using above sql query you can delete the all spam word comments.

For SEO purpose following options are very important.

how to stop wordpress spam comments and increase SEO
how to stop wordpress spam comments and increase SEO

how to display post count of all wordpress tags

In this article, wordpress tutorial, how to display post count of all wordpress tags. In wordpress post we use post tags. For SEO purpose we can show post tags.

how to display post count of all wordpress tags

If we want to show the post count related to wordpress tags.

You can use following code:

<?php
//list all tags that are assigned to posts
$taxonomy = 'post_tag';
$terms = get_terms( $taxonomy, '' );
if ($terms) {
foreach($terms as $term) {
if ($term->count > 0) {
echo '<p>' . '<a href="' . esc_attr(get_term_link($term, $taxonomy)) . '" title="' . sprintf( __( "View all posts in %s" ), $term->name ) . '" ' . '>' . $term->name.'</a> has ' . $term->count . ' post(s). </p> ';
}
}
}
?>
how to display post count of all wordpress tags
how to display post count of all wordpress tags

How to get page id by slug wordpress theme

WordPress tutorial for, How to get page id by slug wordpress theme. First find the page id using page title or page page slug.  we given sample code here.

How to get page id by slug wordpress theme

For post title use following code:

<?php
$page = get_page_by_title( 'About' );
wp_list_pages( 'exclude=' . $page->ID );
?>

For post slug use following code:

 $page = get_page_by_path( 'your-page-slug'
echo $page->ID;

Now List the child page by post slug

if ( $page = get_page_by_path( 'your-page-slug' ) ){
  wp_list_pages( 'orderby=name&depth=1&order=DESC&show_count=0&child_of=' .$page->ID . '&title_li=' );
}

show pdf in post on wordpress

There are people who are struggling for showing PDF file in there wordpress post. Please use following steps for show pdf in post wordpress.

show pdf in post wordpress

1) Go to media -> Add New, upload a file. Once file is uploaded, you will get File URL. Copy that file URL. (Let me call it MY_PDF_URL)

This will be a complete URL, with http://yourdomain.com in it..
2) Now, go to add new post and switch to html editor. Place this code where you want to show the pdf file….

[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.”]

<embed src="MY_PDF_URL" width="600" height="400">

This will work smoothly. OR you can use following code as well.


<iframe src="http://docs.google.com/gview?url=https://purabtech.in/wp-content/uploads/yourpdf.pdf&embedded=true" style="width:880px; height:1200px;" frameborder="0">

[/viral-lock]

There are also nice wordpress plugins for showing the PDF in wordpress posts.

Embed PDF

Will embed a PDF file using Google Docs Viewer Simply include the URL for a PDF document on it’s own line, or wrapped in the embed tag like

Click to access file.pdf

and the plugin will embed the PDF into the page using the Google Docs Viewer embed code. The url must end with .pdf

Supported attributes in the embed tag are class id title height and width

GroupDocs Word, Excel, Powerpoint, Image and PDF Annotate

GroupDocs Annotation lets you embed several types of files into your WordPress pages using the GroupDocs Viewer – allowing inline viewing and annotation of the following file types, with no Flash or PDF browser plug-ins required:

  • Adobe Acrobat (PDF)
  • Microsoft Word (DOC/DOCX)
  • Microsoft Excel (XLS/XLSX)
  • Microsoft PowerPoint (PPT/PPTX)

GroupDocs Annotation lets you view and comment on documents online. Its document annotation features makes it a powerful tool for collaboration. You and your colleagues can collaborate on a document, at the same time, to improve communication and speed up document reviews. GroupDocs Annotation lets you work with text-based documents as well as images. You can collaborate on layouts, drawings and designs just as effectively as on articles, stories and corporate documents. In short GroupDocs Annotation lets you annotate on many file formats including PDF’s, Word documents, Excel documents, Powerpoint documents and many other available formats.

show pdf in post wordpress
show pdf in post wordpress

 

for showing flash intro in sites and flash with wordpress website, we have written article. You might need for your website.

solved: unable to upload images in wordpress

This is very common issue with wordpress websites. Many times we solved (unable to upload images in wordpress) same issue So we written detailed article on same topic. This is very common issue with linux or windows server or computer. When you do the wordpress setup you need to give the write able permission to your wp-content/uploads folder.

If you got the following error: when you upload the image.

“Screen Shot 2013-01-28 at 13.53.32 PM.png” has failed to upload due to an error: Unable to create directory wp-content/uploads/2013/01. Is its parent directory writable by the server?

if you are using windows then right-click the uploads folder and uncheck the is read checkbox. Change ownership of uploads folder. Change owner to apache.

solved: unable to upload images in wordpress

if you are using the linux then use following command:


chown apache:apache -R wp-content/uploads

solved: unable to upload images in wordpress
solved: unable to upload images in wordpress

 

Best of Resources for wordpress theme development

Many new designers and developers are searching for resources for wordpress theme development. Where to start and how to start the wordpress development. Many people don’t want to use the free themes and they want to develop their own theme.

Best of Resources for wordpress theme development

They want to understand about basic rules and api about wordpress theme development. Here we collected some best of urls which has best practices and guidelines about wordpress theme development.

List of free wordpress theme frameworks for wordpress theme developer

How to create wordpress theme

How To Create WordPress Themes From Scratch Part 1

How to Create a WordPress Theme from Scratch

Theme Development

Template Tags for wordpress

Blog design and development

Designing a WordPress Theme From Scratch

Future of PSD to WordPress Conversion

All time Best WordPress Ebooks

General Guidelines when you are developing the new Theme

How to create simple wordpress theme

Basic CSS rules for development of WordPress themes

I liked one picture which about wordpress theme development. This picture is by Yoast blogger.

Best of Resources for wordpress theme-development
Best of Resources for wordpress theme-development

add google plus button to wordpress without plugin

Many people asking me how to add the google plugin button in wordpress without plugin. WordPress tutorial for, add google plus button to wordpress without plugin. You can easily add the google plus button counter to your wordpress website.

add google plus button to wordpress without plugin

I added the google button code to digcms.com site.

You just need to add the following code to site.


&lt;!-- Place this tag where you want the +1 button to render --&gt;
&lt;g:plusone size=&quot;tall&quot;&gt;&lt;/g:plusone&gt;

&lt;!-- Place this render call where appropriate --&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
 (function() {
 var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
 po.src = 'https://apis.google.com/js/plusone.js';
 var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
 })();
&lt;/script&gt;

For getting the different style of google plus button you can go to following site.

http://www.google.com/webmasters/+1/button/

add google plus button to wordpress without plugin
add google plus button to wordpress without plugin

Add feedburner email subscription wordpress without plugin

WordPress tutorial for, Add feedburner email subscription wordpress without plugin. We given full detailed explanation with screenshot and steps for adding feedburner email subscription wordpress without plugin.

Many blogger and people want to add the feedburner RSS feed email subscription form in their website.

Add feedburner email subscription wordpress without plugin

What is RSS?

The easiest way to receive latest posts from your favorite blogs is to subscribe to RSS using feed readers such as Google Reader, Bloglines, NetVibes.
RSS (means Really Simple Syndication) retrieves the latest content from the sites you are interested and pulls them into your feed reader where you can read them all in one location rather than visiting each site separately.

What is FeedBurner?

Most blogs have RSS feed which is detected automatically by commonly used feed readers when the blog URL is added to the reader.

 

Setting Up Your Feedburner Feed

1.  Go to Feedburner and sign in to Feedburner with your Google Account (create a Google Account first if you don’t have one!).

However, if you want to make it more obvious and easier for readers to subscribe using RSS, or want to know exactly how many people subscribe to your blog then the best option is to add a Feedburner RSS feed and email subscription to your blog.

 

After creating feedburner account go to

1.  Click on the Publicize Tab > Email Subscription in your Feedburner account and click on Activate.

2.   Copy the HTML code.

Add feedburner email subscription wordpress without plugin
Add feedburner email subscription wordpress without plugin

 

After this go to wordpress admin panel and go to widget section and choose text widget.

Add a text widget to the desired sidebar by dragging it from the Available Widgets into the Sidebar area on the right.

The widget will automatically open — just add the HTML code for Feedburner email subscription, click Save and then Close.

 

This widget will look as follows:

Add feedburner email subscription wordpress without plugin
Add feedburner email subscription wordpress without plugin

If you like this article then please subscribe my blog.