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.
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.
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.
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.
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
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.
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).
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)
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.
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.
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
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.
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.
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
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.”]
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:
I created file called sharebox.php and in that file just written following code.
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
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
you just need add following code into your functions.php file. This file you can find in your wordpress theme folder.