add different background image to each wordpress posts

WordPress tutorial, add different background image to each wordpress posts. You can change the background images for each wordpress post or change color.  you can change the background color also. Some times this can be doable through CSS also. But here I am going to give you very simple technique.

add different background image to each wordpress posts

Following code you just need to place in your single.php file.

 


if(is_single('17')){
// When Post 17 (ID) is being displayed.

echo "<style>
body{
background: #000 url(images/bgbody.jpg) top center no-repeat;
}</style>";
}

This way you can add the different background image to each wordperss post.

add different background image to each wordpress posts
add different background image to each wordpress posts

 

how to get random posts in wordpress

Wordpres tutorial, how to get random posts in wordpress. Many times we need the random post from wordpress. Like for old tweet or if you want random posts.  Like for old tweet or if you want to show random posts on home page. That is very easy wordpress provided simple method for this.

how to get random posts in wordpress

You just need to add the following query post code before loop.


 <?php query_posts(array('orderby' => 'rand')); ?>

//post data code will go here.

This way can easily show the random posts on home page.

Above is manual method for showing random posts in wordpress. If you want to show random posts using wordpress plugin than use smart widget post.

how to get random posts in wordpress

how to add top button in wordpress website

Adding top button link is always good for users of blog. This is good for SEO also and your blog became more seo friendly this way.

how to add top button in wordpress

You just need to add the following CSS code into style.css file.


#topbutton{display: block;border: 0;position: fixed;  bottom: 20px; right:0;

After this open your header.php file from your wordpress theme folder and after body just add following link code in that file.


<a name="top"></a>

After this open your footer.php file and at the end of body tag add following code in that file.


<a href="#top"><div id="topbutton">
bloginfo('template_directory'); ?>/images/top-button-wordpress.png" />
</a>

put following image in your wordpress theme’s images folder. Just right click and save the image and put that in your images folder.

You can change css as per your requirement. This article is written by purabtech.in. If you are having any dobuts then please write to me.

Your button link will look like as follows:

add top button in wordpress
add top button in wordpress

how to embed google map in wordpress

Google map is common requirement in every website. I worked on google map v3 in javascript. we will how to embed google map in wordpress. we have List of wordpess plugins in this article. As we know more than 18 million sites are created in wordpress. Google map now became very advanced now. Google map version 3 is really great. I worked on google map v3 in javascript.

how to embed google map in wordpress

Now every second site need to google map integration. Here In this article I will show how to add the google map in wordpress site.

how to embed google map in wordpress
how to embed google map in wordpress

Here I created list of google map plugins which can be useful for wordpress. Using following wordpress plugin you can add the google map into your site.

Google Maps Ready!

Google Maps Ready embed google map in wordpress
embed google map in wordpress

Easy to use and powerful Ready! Customize google map and add to the post/page with shortcode or use as a widget. Allow to open maps in pop-up. Add markers with text, images, links description and custom icons. embed google map in wordpress, Categories and sort markers and location points.

Google Maps plugin Features

  • Custom markers. Set marker description, icon and animation
  • Works with any Responsive themes
  • Markers Groups and Clusters
  • Add location by searching or coordinates
  • Fully customizable. All features of the map or marker can be switched off/on
  • Support for localization
  • Works in sidebars, posts, pages, custom post types or as widget
  • Use integrated address search (Google Places API) for quickly finding your places and locations
  • CSV import and export maps and markers data
  • embed google map in wordpress

Inline Google Maps

This is the most complete and advanced Google Maps plugin to be used in your WordPress blog or any other content manager or even plain HTML pages.

It helps you very easily insert simple to complex Google Maps in your pages from a plain Google Maps URL, remote or local KML file.

Google Maps for WordPress

This plugin allows you to easily insert Google Maps into your blog, making use of the new shortCode system in WordPress 2.5. The maps can be configured to offer directions to or from the location, show or hide the zoom/pan controls, show/hide map type (street view, satellite, etc), activate zoom using mouse wheel, and more. PHP5 Required.

XML Google Maps

This plugin allows you to easily insert Google Map or Google Earth Plugin Maps into your blog. You just have to add a link to your self defined Map from My Google Maps, Picasa Webalbum Picture Map, any geoRSS Feed (like Flickr), your uploaded Google Earth file (kmz, kml) or any other dynamic or static Google Earth file (umapper.com, flickr.com, etc.).

Even if you have a GPX-File from your GPS, upload it, link it and it get displayed. For GPX-Tracks you can even display speed, elevation charts (Google Charts API) and a data table with checkpoints (distance, time, average speed, max speed, climb up, climb down).

Multi Google Maps

This is first plug-in that allows you to insert Multi Google Map V.3 Objects into your post/blog, No require Google Map API Key. Next version, this plug-in supports to display Multi Google Map on Popup. By the way , If you have any questions or suggestions, please feel free to contact me. (siripol.n at gmail dot com)

Google Maps v3 Shortcode

This plugin allows you to add a google map into your post/page using shortcodes.

Features:

  • multiple maps on the same post
  • set map size
  • set zoom level
  • set map type
  • set location by latitude/longitude
  • set location by address
  • add marker
  • add custom image as map icon
  • add KML via URL link
  • show traffic
  • support for Google My Maps

Google maps

This plugin will let you easily embed Google maps in your posts. It will produce clean XHTML code without any iframe.

Features:

  • add an embed Google map in your post by using this syntax [map:http://permalink_to_your_Google_map 640 480] “width” (640 in the example) and “height” are optional parameters. You can use px or %,
  • it could be a recorded map or any other map you’re consulting (some complicated map can’t be shown) some examples are availables on my blog,
  • double-click or use your scrolling mouse button to zoom on,
  • internationalization of the plugin,
  • XHTML conform,
  • tested and working on IE6, IE7, IE8, Firefox, Opera, Chrome, Safari,

Here is another article which will help you to add google map in wrodpress.

Add google maps in wordpress post

This list made by purabtech.in. If you need any help about integrating google map into wordpress then please write to me.

how to add buttons to wordpress wysiwyg editor

You can add buttons to wordpress wysiwyg editor using following code. For changing wordpress wysiwyg editor, we need to use the quick_tags.js file using hook.

how to add buttons to wordpress wysiwyg editor

But from wordpress 3.1 version we can customize the wordpress editor by using wordpress filter.

Adding more buttons to the editor is really easy. Simply paste this snippet into your theme’s functions.php file.

function enable_more_buttons($buttons) {
 $buttons[] = 'hr';
 $buttons[] = 'sub';
 $buttons[] = 'sup';
 $buttons[] = 'fontselect';
 $buttons[] = 'fontsizeselect';
 $buttons[] = 'cleanup';
 $buttons[] = 'styleselect';
 return $buttons;
}
add_filter("mce_buttons_3", "enable_more_buttons");
how to add buttons to wordpress wysiwyg editor
how to add buttons to wordpress wysiwyg editor

Note: If you are not wordpress developer then do not use above code. Ask your developers to do this for you.

wordpress and jquery conflicts – How to solve that

Jquery is most powerful javascript framework and which is used widely. WordPress is most powerful and famous cms in the world. When you are using the jquery in wordpress that time you need to keep in mind some issues. WordPress itself uses the jquery in there framework. But when we tries to add the different versions of jquery and there plugins, there was issue or conflict with jquery. Sometimes I saw issue with some plugins due to different versions of jquery. I shown in this tutorial, how to solve the wordpress and jquery conflicts easily.

wordpress and jquery conflicts – How to solve that

wordpress and jquery conflicts
wordpress and jquery conflicts

Many people written the jquery wrapper around the jquery. They written in different style but when some jquery developers written or used same function name or same methods then jquery conflicts is happening.

WordPress itself uses the jquery for custom purpose. So you dont need to add the jquery script again in to wordpress. you just need to put following code in your wordpress theme for adding the jquery in your theme.


<!--?php wp_enqueue_script("jquery"); ?-->

Just put above lines in your header.php file for adding the jquery into your wordpress theme.

For removing the conflicts when you are using the jquery functions. just use following noconflict code in that.


 $.noConflict();
 // Code that uses other library's $ can follow here.


This technique is especially effective in conjunction with the .ready() method’s ability to alias the jQuery object, as within callback passed to .ready() we can use $ if we wish without fear of conflicts later:

<script type="text/javascript">// <![CDATA[
 $.noConflict();
 jQuery(document).ready(function($) {
 // Code that uses jQuery's $ can follow here.
 });
 // Code that uses other library's $ can follow here.
// ]]></script>

Following is the some example for remove the conflicts from jquery with wordpress.

Just use the jquery multiple times for each jqeury plugins. That is the easiest way to solve the jquery conflicts.

But if you are having some knowledge of jquery then use the following code for remove the conflict.

var j = jQuery.noConflict();
// Do something with jQuery
j("div p").hide();
// Do something with another library's $()
$("content").style.display = 'none';

For many purpose we use the jquery in wordpress. Mainly jquery is used for sliders and menu and gallery.
For menu or slideshow use jquery in following fashion.

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

<script type="text/javascript">// <![CDATA[
 $.noConflict();
 jQuery(document).ready(function($) {
 // Code that uses jQuery's $ can follow here.
 });
 // Code that uses other library's $ can follow here.
// ]]></script>

[/viral-lock]

If you still facing issue with jquery then please write to me on support@purabtech.in.

Here are some useful resources and links about Jquery and wordpress.

100+ jquery and CSS techniques and Tips and tutorials
jquery tips for wordpress theme developers
Fadein and Fadeout effect through javascript
minimize, restore, maximize and hide functionality with javascript without using jquery
Complete Javascript form Validation now easy ( Checkbox, Websites, Email, Maxlength)

where to submit free wordpress themes

When I started developing the wordpress theme I was worried about where to submit the wordpress theme. I already developed many wordpress plugins but that plugins I submitted to wordpress plugin site. If you are wp theme developer and you want to publish your theme on multiple sites them here is list of URLs where you can submit free wordpress themes.

submit free wordpress themes
submit free wordpress themes

After doing googling I found some site where I can submit my wordpress theme and then I can get more traffic for my wordpress themes.

You can submit your wordpress theme to our site. Please send email to our team with theme screenshots and description. You need to send demo URL and download link for your wordpress theme. We will publish your wordpress theme on our showcase page.

You just need send email to our team on wordpressapi@gmail.com

You can check our wordpress theme showcase page:

Our Showcase for Free wordpress themes

Here I created the list websites where you need to submit your wordpress theme:

[viral-lock message=”Lists are 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.”]

[/viral-lock]

Share buttons in wordpress without wordpress plugin

I don’t recommend you to use wordpress plugin for adding the share buttons. we have simple code for add Share buttons in wordpress without wordpress plugin

Share buttons in wordpress without wordpress plugin

There are many wordpress plugins available for adding share button in wordpress or any website. I don’t recommend you to use the wordpress plugin for adding the share buttons like, facebook, twitter, linkedin, stumbleupon, delicious and Google buzz. Because when you install wordpress plugin for social buttons then that plugin will use your database and on every page view that will fire query to your database and your page view will became little bit slower. If you are having less visitors then this ok but if your site is having large visitors than you need to think about small issues also. Floating share button are very popular these days. You can easily add the sharebox which floating bar. Using following code you can add the share buttons without wordpress plugin.

I written some code for this and on my site share buttons are looking as follows:

Share buttons in wordpress without wordpress plugin
Share buttons in wordpress without wordpress plugin

I created file called sharebox.php and in that file just written following code.

<div id="sharebox" style="">
<a href="http://twitter.com/share" data-count="vertical" data-via="digcms">
Tweet</a>
<script type="text/javascript" src="http://platform.twitter.com/widgets.js">
</script>
</div>
<div>
<script>var fbShare = {url: <?php the_permalink() ?>,size: 'large',badge_text: 'fff',badge_color: '3b5998',google_analytics: 'true'}</script>
<script src="http://widgets.fbshare.me/files/fbshare.js"></script>
</div><div>
<script src="http://www.stumbleupon.com/hostedbadge.php?s=5"></script>
</div>
<div><a class='delicious-button'  href='http://delicious.com/save'> <!-- { url:"<?php the_permalink() ?>" ,title:"<?php the_title() ?>" } --> Save on Delicious</a></div><div style="display:none;">

<script type="text/javascript">(function() {var s = document.createElement('SCRIPT'), s1 = document.getElementsByTagName('SCRIPT')[0];s.type = 'text/javascript';s.async = true;s.src = 'http://widgets.digg.com/buttons.js';s1.parentNode.insertBefore(s, s1);})();</script><a></a>

</div>

<div><a title="Post on Google Buzz" href="http://www.google.com/buzz/post" data-button-style="normal-count"></a>
<script type="text/javascript" src="http://www.google.com/buzz/api/button.js"></script>

</div><div><script type="text/javascript" src="http://platform.linkedin.com/in.js"></script>
<script type="in/share" data-counter="top"></script></div></div>

After creating sharebox.php file, open your single.php file and put following code in that file.

<?php include 'sharebox.php'; ?>

After that open your style.css file and put following code in that file.

#sharebox{display: block;margin-left: -85px;
position: fixed;top:105px;width:65px;
border:#ccc 1px solid;padding:2px}

If you need more buttons then you should prefer following article. In this article you will find the all the share button code. and you dont need to add any wordpress plugin for adding share or like buttons in wordpress site.

Please write comment for our article: Share buttons in wordpress without wordpress plugin

Add the social Bookmark Icons in WordPress theme without plugins

how to display wordpress categories in a drop down menu

wordpress tutorial, how to display wordpress categories in a drop down menu. For showing the categories in drop down menu just use our following code.

how to display wordpress categories in a drop down menu

You just need to copy paste following code in put in functions.php file.


<li id="categories"><h2><?php _e('Posts by Category'); ?></h2>
 <?php wp_dropdown_categories('show_option_none=Select category'); ?>

<script type="text/javascript"><!--
 var dropdown = document.getElementById("cat");
 function onCatChange() {
 if ( dropdown.options[dropdown.selectedIndex].value > 0 ) {
 location.href = "<?php echo get_option('home');
?>/?cat="+dropdown.options[dropdown.selectedIndex].value;
 }
 }
 dropdown.onchange = onCatChange;
--></script>
</li>

For more information you can use the following code.

how to display wordpress categories in a drop down menu
how to display wordpress categories in a drop down menu

How to hide wordpress visual editor and HTML editor

If you want to hide the wordpress editor from admin panel then you can use the following code in functions.php file. This is achieved with very simple css trick. You just need to add the following hook into your functions.php file which you can find in your wordpress theme folder.

you can do this in two ways. First with using admin panel.  First thing you need to do is login to your WordPress admin panel.

Then you would need to go to Users > Your Profile,

Just disable visual editor checkbox. That sit. But if you want to this setting to done for all wordpress users then you can use following code.

How to hide wordpress visual editor and HTML editor

How to hide wordpress visual editor and HTML editor
How to hide wordpress visual editor and HTML editor

you just need add following code into your functions.php file. This file you can find in your wordpress theme folder.

 

add_action('admin_head', 'hide_post_box');

function hide_post_box() {
?>
<%%KEEPWHITESPACE%%> <style>
<%%KEEPWHITESPACE%%> #editor-toolbar{ display:none; }
<%%KEEPWHITESPACE%%> #editorcontainer{ display:none; }
<%%KEEPWHITESPACE%%> #quicktags { display:none; }
<%%KEEPWHITESPACE%%> #post-status-info { display:none; }
<%%KEEPWHITESPACE%%> </style>
<?php
}