Pages

Ads 468x60px

Showing posts with label Wordpress Tips. Show all posts
Showing posts with label Wordpress Tips. Show all posts

Sunday, 9 September 2012

WordPress Themes Hack

This wordpress themes hack has tested. Modifying the wordpress themes code can cause your wordpress themes error. We cannot guarantee that problems resulting from modifications the wordpress themes. Use this tutorial at your own risk. I have tried all that mentioned here in wordpress 2.7, wordpress 2.7.1 and wordpress 2.8 and all wordked.
A. Embed Google Adsense In First WordPress Post
To place an ad after the first post title in your WordPress blog main page

  1. Open the WordPress admin control panel and navigate to: Presentation > Theme Editor
  2. Select the Main Index Template (index.php) from the list of templates on the right.
  3. In the Main Index Template, find the line that starts with:
    <?php if (have_posts())
  4. Add the following line above it:
    <?php $count = 1; ?>
  5. Next, find the line that starts with:
    <?php the_content
  6. After the closing tag ?> for that section (it may wrap to multiple lines), add the following code:
    <?php if ($count == 1) : ?>
    – Insert your Google AdSense code here –
    <?php endif; $count++; ?>
  7. Click Update File.
This places the ad within the first post.  If instead you want the ad to appear between the first and second post, add the code from step 6 after the closing </div> tag for the “entry” div that contains the line <?php the_content.
Source: http://www.devtopics.com/embed-google-ad-in-first-wordpress-post/
B. Adding Comment Numbers To Your WordPress Theme
Here are the steps you can take to easily add numbers to your WordPress theme’s comments section.
  1. First thing you will want to do is create a backup your comments.php file.
  2. Locate the comments.php file.
  3. Locate the code that starts the comment loop. It will look something like this:
    <?php if ( $comments ) : ?>
  4. Place this code immediately above the code in Step 3:
    <?php $i = 0; ?>
  5. Now locate the code that looks like this:
    <?php foreach ($comments as $comment) : ?>
  6. Placed this code immediately below the code in Step 5:
    <?php $i++; ?>
  7. Now use this code where you want to display your comment numbers:
    <span class=”count”>
    <?php echo $i; ?>
    </span>
  8. Click Save.
  9. Now go to your stylesheet (style.css) and place this code anywhere on the stylesheet (probably best placed in the comments section):
    .count {
    float:right;
    padding: 10px;
    font-size:18px;
    color:#000000;
    }
You can adjust the stylesheet to fit your comment numbers into the placement and appearance that you want them to have.
Source: http://wphacks.com/how-to-adding-comment-numbers-to-your-wordpress-theme
C. Separate WordPress Comments and Trackbacks
  1. Access your comments.php file and locate the following code:
    <?php foreach ($comments as $comment) : ?>
  2. Immediately after the above code, you’ll want to place this code:
    <?php $comment_type = get_comment_type(); ?>
    <?php if($comment_type == ‘comment’) { ?>
  3. Next, you’ll want to scroll down a little bit and locate the following code:
    <?php endforeach; /* end for each comment */ ?>
  4. Immediately before the above code, you’ll want to place this code:
    <?php } /* End of is_comment statement */ ?>
    This will filter out all of the trackbacks and pingbacks from your main comments loop. Now we need to create a second comments loop to display the trackbacks and pingbacks.
  5. Almost immediately below the code from step 2 you should find this code:
    <?php else : // this is displayed if there are no comments so far ?>
    Immediately before the above code, you’ll want to place this code:
    <h3>Trackbacks</h3>
    <ol>
    <?php foreach ($comments as $comment) : ?>
    <?php $comment_type = get_comment_type(); ?>
    <?php if($comment_type != ‘comment’) { ?>
    <li><?php comment_author_link() ?></li>
    <?php } ?>
    <?php endforeach; ?>
    </ol>
    You can adjust this code to display how you want to, including using a different header if you have a specific look for your header 3.
Source: http://wphacks.com/how-to-separate-wordpress-comments-and-trackbacks
D. Display the most commented posts
Copy and paste following code to your wordpress themes to display most commented post.
<h2>Most commented posts</h2>
<ul>
<?php
$result = $wpdb->get_results(“SELECT comment_count,ID,post_title, post_date FROM $wpdb->posts ORDER BY comment_count DESC LIMIT 0 , 10″);
foreach ($result as $topten) {
$postid = $topten->ID;
$title = $topten->post_title;
$commentcount = $topten->comment_count;
if ($commentcount != 0) {
?>
<li><a href=”<?php echo get_permalink($postid); ?>”><?php echo $title ?></a></li>
<?php }
}
?>
Source: http://www.wprecipes.com/how-to-display-the-most-commented-posts-of-2008
E. WordPress Recent Posts from specific category
<ul>
<?php $recent = new WP_Query(“cat=catID&showposts=10″); while($recent->have_posts()) : $recent->the_post();?>
<li><a href=”<?php the_permalink() ?>” rel=”bookmark”>
<?php the_title(); ?>
</a></li>
<?php endwhile; ?>
</ul>
Replace catID with post category to be displayed.

Protects Your WP Blog with WordPress Antivirus Plugin

WordPress Antivirus plugin  is the first Antivirus plugin for WordPress. This plugin effective to protect your blog blog against exploits and spam injections. And this plugin available for free, so you can install and use this plugin in your blog without pay a few cent. This plugin also provides easy to use interface.
I think at this time, Anti Virus WordPress plugin is a smart and effective solution to protect your WordPress blog.
Wordpress Antivirus Plugin
Features WordPress Antivirus
  • Support The latest version of WordPress
  • Detect the current WordPress permalink back door
  • Easy to use and easy to install, just  activate, check, done!
  • Manual testing with immediate result of the infected files
  • Daily automatic check with email notification
  • Whitelist: Mark the suspicion as “No virus”
  • Support for the following language: English, German, Italian, Persian
How to install WordPress Antivirus Plugin on your Blog
  1. Download wordpress AntiVirus plugin
  2. Unzip the downloaded file. It will create antivirus folder.
  3. Upload the folder antivirus into ../wp-content/plugins/
  4. Go to tab Plugins and then Activate AntiVirus plugin
  5. Edit settings. WordPress Antivirus plugin ready for use.
Download WordPress antivirus plugin here: http://wordpress.org/extend/plugins/antivirus/
Note: This Plugin only available on WordPress platform.

How to Add Adsense Search to WordPress Theme“Tricks WP Theme V2”


This tutorial to answer Aditya Perdana’s question and for all and all bloggers who use the “Tricks Theme Version 2” on their blogs.
Here the Aditya Perdana’s question “Hello, thanks Fz for your great themes wordpress.  I want to ask, how can I add adsense for search in my custom templates page? Because, I was used your themes but i can’t create custom template for my page
To embed Adsense for search to wordpress theme actually is easy. You can do it easily just a few minutes. Embedding adsense for search into template can increase CTR for adsense search and it mean can increase your adsense earning.
First steps: Create Blank Page
Create a page with no content in your blog then save/publish the page. Now go to next steps to get the “adsense for search” code.
Second Steps: Get adsense for search code
  1. Login to your adsense account Click “AdSense Setup”, click “ Get Ads” then click “AdSense for Search”
    Get adsense search code 1
  2. Select search type. Only the site I select or entire web, I suggest select “Only sites I select” then entering you blog url. click continue.
    Get adsense search code 2
  3. “Choose Search Box Options”.  Select look and feel adsense search which you want then click continue.
    Get adsense search code 3
  4. On “adsense location” selects “Top and Bottom”.  On “Opening of search results page” select “Open results within my own site” and enter and enter the URL/permalink of blank page that you created above. On “Enter width of results area:” enter 550px (The width of result area depending to your WP theme design. I use 550 px because width area for content of Tricks Theme V2 is 550px). If all setting finished click continue
    Get adsense search code 4
  5. Last steps, enter Name Your Search Engine e.g “tricks-collections.com” or other, then click “submit and get the code” button. Now you can get the adsense for search code. Go to next steps “ how to embed the code to your WP theme”
    Get adsense search code 5
Third steps: Here how to add/embed adsense for search to wordpress theme
  1. Login to wp-admin in your WP blog.  Add Click “appearance” then “widgets” (Your wordpress theme must widget ready).
  2. Add one “Text Widgets” to the sidebar then paste the adsense search code (Search Box Code) into the widgets. Save the setting.
  3. Edit blank page that you created above. Click HTML tab in the post editor, paste the adsense for search code here (Search Result Code) then Save/Update Page.
On this tutorial I use Tricks Theme ver.2. You can download the WP theme here: SEO friendly theme V2

How to Adding Thumbnail Image on WordPress Themes

Some this blog’s reader who have downloaded the tricks theme ask to me “how to Adding Thumbnail Image on Tricks Theme“. Actually to display thumbnail image in the WordPress blog is easy just install the “Get the Image” plugin on WP blog and paste a small code in the WP theme.
Get the Image plugin is a small WP plugin to display thumbnail image easily in the WordPress blog and the plugin updated continuously. The latest version of the get the image plug-in has support for newest version of WordPress. This plugin can grab an image by custom field input, WP’s post image feature, post attachment, or extracting it from the post’s content.
After installing the plugin you can view thumbnail image in your blog like following picture

This tutorial can be applied on all WordPress blog with self hosting. If you have a WP blog on wordpress.com you can’t do this tutorial because wordpress.com not allow user to customize the themes and not allow user to install new plugin.
How to adding thumbnail image on WordPress Themes
It easy, if you are interested with this tutorial you can follow the following tutorial:
  1. Login to you WP blog
  2. Download get the image plugin and install and activate the plugin in your WP blog. You can download get the image plugin from this link: download get-the-image plugin
  3. Copy and paste following code to your WordPress theme where you want to display the thumbnail image in your WP theme then update the theme.
    <?php if ( function_exists( 'get_the_image' ) ) {
    get_the_image ( array(
    'default_size' => 'thumbnail',
    'link_to_post' => false,
    'width' => 135,
    'height' => 135
    ) );
    } ?>
  4. Refresh/reload you blog. Now you can see the thumbnail image has displayed in your blog.
Note: If you Tricks Theme, you can paste the code right before “<?php echo truncate($post->post_content,450); ?>” (view the picture)
thumbnail-image-script (FILEminimizer)
Maybe you are interested with other WordPress tutorial: How to Embed Adsense Search to WordPress Theme or if you are interested to install SEO friendly theme you can download the theme here: SEO friendly WP theme “Tricks theme V2”

How to Reset WordPress Admin Password from SQL

If you are using wordpress platform then the problems comes if you forgot your wordpress admin password.
Don’t worry if you forgot the wordpress admin password. There two ways to reset your wordpress admin password that is from lost your password menu and from SQL, but in this article I just share how to reset your wordpress password from SQL.
An easy way to reset wordpress admin password via SQL, please follow the step below:
  • Please login to your Cpanel account then select phpMyAdmin
How to reset WordPress Admin Password from SQL
  • After in phpMyAdmin please select the WordPress database name that you forgot it from the drop-down menu on the left. The page will refresh and the database’s tables will be displayed on it. Open the SQL tab (look at the top navigation bar).
  • In the text field please write the following SQL query below:
    UPDATE `wp_users` SET `user_pass` = MD5( "new_password_here" ) WHERE `wp_users`.`user_login` = "admin_username";"new_password_here" – Please change this with the new password you want.
    "admin_username"
    – Please change this with the username you want.
Code for How to reset WordPress Admin Password from SQL
  • After you are ready, please click on the GO button to submit the query. If everything goes fine without errors, you should be able to login to WordPress with the new password. Congrats!

How to Install WordPress Using Fantastico DeLuxe, Softaculous and QuickInstall

Previously I’ve been posting about step by step to install wordpress manually, now I will show to you how to install wordpress using auto installer tool like Fantastico DeLuxe, Softaculous and QuickInstall.
Here I will only share the steps about how to installing wordpress with Fantastico DeLuxe, Softaculous and QuickInstall, because I just have an experience with it, and from some hosting provider that I use already, generally they are using auto installer tool like Fantastico DeLuxe, Softaculous and QuickInstall.
How to Install WordPress Using Fantastico De Luxe, Softaculous and QuickInstallPlease follow the instructions below:
1. Install WordPress Using Fantastico De Luxe
  • Please login to your Cpanel hosting account, then select Fantastico De Luxe.
    Install WordPress Using Fantastico Deluxe
  • Then select wordpress menu, and click New Installation, then please fill the form.
  • Once you’ve complete please click Install WordPress button.
  • You are done to install wordpress with Fantastico De Luxe.
2. Install WordPress Using Softaculous
  • Please login to your Cpanel hosting account, then select Softaculous.
    Install WordPress Using Softaculous
  • Then select wordpress menu, and click Install, then please fill the form.
  • You must fill blank In Directory form, so the directory wordpress will be installed on public html.
  • After you’ve complete please click Install button.
  • You are done to install wordpress with Softaculous.
3. Install WordPress Using QuickInstall
  • Please login to your Cpanel hosting account, then select QuickInstall.
    Install WordPress Using QuickInstall
  • Then select wordpress menu, and click Continue button, then please fill the form.
  • After you’ve complete please click InstallNow! button.
  • You are done to install wordpress with QuickInstall, please don’t forget to save your login wordpress data, and usually QuickInstall will send the login wordpress data to your email.
Now your wordpress blog is ready, you can start posting. Happy blogging!
Related Posts Plugin for WordPress, Blogger...
trickstipsall4u.blogspot.com Webutation
MyFreeCopyright.com Registered & Protected

M

ad

Contact Me

flagcounter

free counters