Monday, October 17, 2011

Ajax-based Auto-completing Search Field for your WordPress Theme

Why not helping your visitors to find what they’re looking for on your blog, by using a cool auto-completion on your search field? To do so, we’ll use WordPress tagcloud, php and ajax.
Please note that even if this code is fully functional, this is an experimentation, and the SQL query isn’t really optimized.

The idea

We will use tags as a list of keyword to suggest to the readers.
When someone will start to type on the search field, we will use Javascript to send a request to a php page which will do the following SQL request SELECT * FROM matable WHERE ‘name’ LIKE ‘$search%’. Via Ajax, we’ll send back the request results to our page, and display it to the visitor.
automcompletion-wordpress.png

First part: PHP

The first thing to do is to create a php page. This page will send a request to our WP database and display the tags as a html unordered list.
<?php
if (isset($_POST['search'])) {
        $search = htmlentities($_POST['search']);
} else  $search ='';
$db = mysql_connect('localhost','root',''); //Don't forget to change
mysql_select_db('wp', $db);       //theses parameters
$sql = "SELECT name from wp_terms WHERE name LIKE '$search%'";
$req = mysql_query($sql) or die();
echo '<ul>';
while ($data = mysql_fetch_array($req))
{
        echo '<li><a href="#" onclick="selected(this.innerHTML);">'.htmlentities($data['name']).'</a></li>';
}
echo '</ul>';
mysql_close();
?>
This code is simple: It receive a POST parameter (The letter(s) typed in the search field by the visitor) and then sends a request to our WP database in order to gets all tags starting with the letter(s) typed in the search box.

Part two: Ajax

Now it’s time to start the client-side programming. We need to code 4 Javascript functions in order to make our auto-completion work:
  • Function ajax() will create a XMLHTTPRequest object.
  • Function request() will send an Ajax request to our gettags.php file.
  • Function return() will return gettags.php contents.
  • And the selected() function will update the search field.
Here’s our gettags.js file and the 4 functions needed:
var myAjax = ajax();
function ajax() {
        var ajax = null;
        if (window.XMLHttpRequest) {
                try {
                        ajax = new XMLHttpRequest();
                }
                catch(e) {}
        }
        else if (window.ActiveXObject) {
                try {
                        ajax = new ActiveXObject("Msxm12.XMLHTTP");
                }
                catch (e){
                        try{
                                ajax = new ActiveXObject("Microsoft.XMLHTTP");
                        }
                        catch (e) {}
                }
        }
        return ajax;
}
function request(str) {
 //Don't forget to modify the path according to your theme
        myAjax.open("POST", "wp-content/themes/openbook-fr/gettags.php");
        myAjax.onreadystatechange = result;
        myAjax.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
        myAjax.send("search="+str);
}
function result() {
        if (myAjax.readyState == 4) {
                var liste = myAjax.responseText;
                var cible = document.getElementById('tag_update').innerHTML = liste;
                document.getElementById('tag_update').style.display = "block";
        }
}
function selected(choice){
        var cible = document.getElementById('s');
        cible.value = choice;
        document.getElementById('tag_update').style.display = "none";
}

Part three: Editing your theme

Now that we have our php and javascript ready, we can edit the searchform.php file from your WP theme:
Your searchform.php file should look like this:
<form method="get" id="searchform" action="<?php bloginfo('url'); ?>/">
        <div>
                <input type="text" value="<?php the_search_query(); ?>" name="s" id="s" />
                <input type="submit" id="searchsubmit" value="Search" />
        </div>
</form>
We have to add a div, which will display the received data from the request, as well as a Javascript event on the search form:
<form method="get" id="searchform" action="<?php bloginfo('url'); ?>/">
    <div>
        <input type="text" value="<?php the_search_query(); ?>" name="s" id="s" onkeyup="request(this.value);"/>
        <input type="submit" id="searchsubmit" value="Search" class="button" />
    </div>
    <div id="tag_update"></div>
</form>

Final part: CSS

Due to the fact that every theme use different color schemes, this is only an example. Anyways, I thought it could be a good start:
#tag_update {
        display: block;
        border-left: 1px solid #373737;
        border-right: 1px solid #373737;
        border-bottom: 1px solid #373737;
        position:absolute;
        z-index:1;
}
#tag_update ul {
        margin: 0;
        padding: 0;
        list-style: none;
}
#tag_update li{
        display:block;
        clear:both;
}
#tag_update a {
        width:134px;
        display: block;
        padding: .2em .3em;
        text-decoration: none;
        color: #fff;
        background-color: #1B1B1C;
        text-align: left;
}
#tag_update a:hover{
        color: #fff;
        background-color: #373737;
        background-image: none;
}
That’s all. You now have a very nice auto-completing search form! If you have any questions, feel free to leave a comment below.

Designig Your WP audio player

You can change the color of the various components of the audio player, by including additional pieces of code in the shortcode (for the standard shortcode see here). You add them right after the URL of the mp3, as shown in this Support info page; their example:
[audio http://wpcom.files.wordpress.com/2007/01/mattmullenweg-interview.mp3 |bg=0x0000ff|righticon=0xff0000]
But I thought I might make things more clear by showing which piece of code corresponds to which component of the audio player (plus correct a couple of mistakes and omissions):
audioplayer
0: |skip=0xHEX [← not included in the Support page]
1: |leftbg=0xHEX
2: |lefticon=0xHEX
3: |bg=0xHEX
4: |righticon=0xHEX
5: |rightbg=0xHEX
6: |text=0xHEX
7: |tracker=0xHEX [← Support page has "slider" instead of "tracker"]
8: |loader=0xHEX
9: |track=0xHEX
10: |border=0xHEX
11: |bgcolor=#HEX [← not the way the Support page has it]
12: |volslider=0xHEX [← not included in the Support page]
13: |voltrack=0xHEX [← not included in the Support page]
When hovering over:
audioplayerhover
14: |righticonhover=0xHEX
15: |rightbghover=0xHEX
Where I’ve written “HEX”, you paste the hex number for the desired color; to find colors/numbers, you can consult this (or other similar webpages).
No.11 must be changed if the background to the text is not white in the theme you’re using; to find your blog’s colors, you can use the “Colors (finder)” links in my left sidebar. Or you can eliminate no.11 altogether, by adding this:
|width=80
Note 1: The images above display the default look of the audio player, i.e. what you get if you don’t add any extra command.
Note 2: The Support info page includes this phrase: “In order to use the audio player and upload music to your blog, you will need to purchase the Space Upgrade.” This is misleading, as you definitely don’t need the space upgrade to use the audio player: you can upload your mp3s in a free file host such as Fileden or Getdropbox, get the direct URLs from there and use them with the audio player shortcode.
[Update: Support info page corrected; it now reads: "You can share music on your blog by linking to an audio file, by purchasing the space upgrade and uploading music files to your media library, or by using a third-party service."]
Note 3: Additional options Below

The current version of the WP audio player includes some additional options not documented in the outdated Support info page [Update: now included in the new Support doc]. As in the case of the color options, you activate them by adding extra pieces of code before the closing bracket of the player shortcode (for the standard shortcode):
|titles=TITLE HERE track title
|artists=NAME HERE artist name
|remaining=yes shows remaining rather than elapsed track time
|initialvolume=NUMBER HERE initial volume level (from 0 to 100; default is 60)
|loop=yes loop play
|animation=no player always open
|width=NUMBER HERE player (open) width; default is 290
You can also have a group of tracks in the same player, by pasting their URLs the one after the other, separated by commas; same thing for the (optional) track titles and artist names. For example:
[audio URL1 HERE,URL2 HERE|titles=TITLE1 HERE,TITLE2 HERE|artists=NAME1 HERE,NAME2 HERE]

Tuesday, October 4, 2011

WordPress Search Engine Optimization (SEO) some of the techniques


1. Write keyword rich post titles – it almost goes without saying, but the post title is the most important part of the blog post for many reasons. From your reader’s perspective, a descriptive and compelling title helps them decide if your post is worth reading or not. From an SEO perspective, think about the keywords or phrases people might type into a search box to find your post 2 months from now, and use those words or phrases in your post title. For maximum benefit, try to avoid titles that are cute, clever or cryptic.
2. Make your post titles live links – many of the WP themes already do this, but if yours doesn’t, you can add the necessary code pretty easily. In your Main Index Template and Page Template, find the code for the post tiltle. It’ll probably look like this:
<h2><?php the_title(); ?></h2>
To link your post titles, you’ll want to replace that code with the following (be sure to leave out the “#” symbols):
<h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h2>
3. Optimize your permalinks – the default WP 2.0 installation displays permalinks this way: http://www.wpbag.com/?p-123. A more search-engine friendly permalink includes the post title in the link, like this: http://www.wpbag.com/2006/01/16/keyword-rich-post-title/. This is a simple change to make. In your WP admin panel, click on the “Options” tab, then the “Permalinks” sub-tab, and choose the option just below the “Default” permalink option. See the WordPress Codex for more on permailinks.
4. Optimize your page titles – According to most SEO experts, the page title tag is one of the most important tags on your page. In most WP themes, you’ll find the page title tag in the Header Template, and the default version ususally looks like this:
<title><?php bloginfo('name'); ?><?php wp_title(); ?></title>
The best tweak I’ve seen to optimize this tag comes from Stephen Spencer, who suggests using the following code for page title tag (omit the “#”):
<title><?php if (is_home()) { print "whatever title I want to have on my blog home page."; } else { wp_title(' '); print " : "; bloginfo('name'); } ?></title>
This tweak does a couple different things. First, it allows you to use a more descriptive, keyword-rich title for your blog’s main page. And second, for the individual post pages, it will use the title of your post as the page title, which is another reason to follow the advice I mentioned in #1 above.
5. Use the related posts plugin – Alex Malov’s Related Entries plugin is a neat little addition to any WP blog. Not only does it enhance your blog’s usability, but it also helps create a dense link structure throughout your site, which makes it easier for the search engine spiders to find and index older blog posts.
6. Use the Google sitemap plugin – According to Google:
“Google Sitemaps is an easy way for you to submit all your URLs to the Google index and get detailed reports about the visibility of your pages on Google.”
WordPress user Arne Brachold has made the sitemap creation and submission process fairly simple with his Google Sitemap plugin, which was recently updated for WP 2.0. This plugin will create a sitemap for you and submit it to Google.
Additionally, Elliot Kosmicki offers a script that will convert your Google sitemap into a Yahoo compliant sitemap that you can submit to Yahoo.
7. Add meta keyword tags and Technorati tags to your posts automatically – although it’s questionable whether or not meta keywords are still valuable when it comes to SEO, ultimately, they can’t hurt. As far as Technorati tags, they have little impact on SEO, but they can help increase your traffic directly from Technorati, so it’s a good idea to use them.Rick Boakes created the Autometa plugin that will add both tags to your posts automatically.
Another simple and effective Technorati tag generator I’ve used is Broobles’ Simple Tags plugin.
8. Validate your code – Use the W3C Markup Validation Service to ensure the code behind your pages is clean and valid. If you find your pages have errors in the code, hire or make friends with a savvy web developer to help you clean it up. See Google’s Information for Webmasters for more info on creating a technically valid site.
If you have further SEO tips for WordPress blogs, I’d love to hear about them in the comments.

Sunday, September 25, 2011

Arthemia Premium wordpress theme - Free Download (hotfile,filesonic,mediafire)

Arthemia Premium is a magazine style theme that unleashes the power of WordPress, transforming it into a simple-yet-powerful CMS with the automatic thumbnail generation feature. A nice and elegant blend of a blog and a magazine.

Preview:
http://demo.colorlabsproject.com/arthemia/
Download:
http://megaupper.com/files/NBJXZKUE/arthemia-premium.zip
http://www.mirrorcreator.com/files/WTCTGMGM/arthemia-premium.zip_links
http://www.megaupload.com/?d=I7UH7EFD
http://rapidshare.com/files/451829132/arthemia-premium.zip

Saturday, September 24, 2011

My Magazine - Wordpress Theme - Download

                
Dowload | Demo

Description

This theme was created with content rich websites in mind. It can be used for media and videogames sites as well as news sites and technology portals alike. It is very easy to configure and makes running a news portal as easy as it gets. Wow your client and/or users with this great magazine style wordpress 3.0 template. Even if you have not a content rich site, but running a personal blog and like this style, this theme is right for you! You can disable the mainpage or set it up with the included 7 custom premium widgets. Get MyMag now for your personal or professional project!


 Tags: MyMagazine Theme forest Theme free download,mediafire download,megaupload dowload,filesonic download

Multimedia - Music, Video, Picture, Wordpress Theme Download

 

Download   |     Demo

MULTIMEDIA THEMES [WORDPRESS]

  • 7 Theme Style
  • Option Tree (Wp Envato Admin Panel)
  • Easy Install and Ready Shortcode
  • Full Ajax Control
  • Popup, Iframe, Video, Link (Ajax)
  • Ready 50+ Button
  • Short Code (20+)
  • Custom Fields
  • 7 Ready Widgets
  • 11 Help Videos (Include Folder)
  • IE7 , IE8, Chrome, Firefox and Opera, Safari other browser

COLOR

  • Default (Music Live)
  • Happy Theme
  • Piano Theme
  • City Theme
  • Play Theme
  • Casette Theme
  • Tape Theme

Page

  • Home Page
  • About us page
  • Services Page
  • Blog Page
  • Blog Page Style Two
  • Blog Page Style Three
  • Blog Page Style Four
  • Blog Page Style Five
  • Blog Read – Single Page
  • Login Page
  • Signup Page
  • Search Page
  • Music Playlist Page
  • Video Playlist Page
  • Photograph List Page
  • Portfolio One
  • Portfolio Two
  • Portfolio Three
  • Portfolio Four
  • Contact Page
  • Ajax Example Page
  • Buttons Example Page
Demo :

http://iamthemes.com/themeforest/wordpress/multimedia/

Details :

http://freeprothemes.blogspot.com/2011/09/multimedia-music-video-picture.html

Download :
http://www.fileserve.com/file/M6yAFmG
http://www.uploadstation.com/file/JtgQKdb
     Tags: Multimedia Theme forest Theme free download,mediafire download,megaupload dowload,filesonic download

    Reviewer - WORDPRESS Theme Download



                   Demo

    Features

    • Five background pattern options
    • Five Star Rating colors
    • Author’s Page Template which lists all of the sites authors
    • Ten font options from Google Fonts
    • Custom “Recent Ratings” Graph Widget
    • Custom “Featured Reviewer/Author” Widget
    • Unlimited color options for links through included color pickers
    • “Featured Posts” on home page which makes use of Sticky Posts with jQuery hovers
    • Two layout options for the content and sidebar
    • Two sidebar styles
    • Widgetized sidebar and footer
    • Five Shortcodes
    • Social Network Icons
    • Supports the plugin Contact Form 7
    • Easy to follow documentation
    • Valid XHTML


    If you would like to make any changes to this theme, I recommend making a child theme so that you can keep the main theme as the most updated version, as I release bug fixes periodically.

    The Reviewer also has an HTML version.