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

Convert A Wordpress Blog To Blogger Simple And Easy Way

Blogger is a very widely used publishing platform, mostly because its strength lies in its simplicity and ease to use. It is quite easy to use, and is recommended for beginner bloggers who are looking for a quick and easy way to create a presence for themselves online. For bloggers who have created a Wordpress blog, but are at loss to maintain or modify it, they have great option in Blogger.



They can easily migrate their WordPress Blog to Blogger without hitch. In this post, we will talk about how you can shift WordPress to free Blogger.

Normally, such a transfer isn't easy. Data needs to be imported from WordPress first, and the imported to Blogger. Since Blogger doesn't allow any data format expect its own, there needs to be a conversation process that will convert WordPress exported files. Luckily, there's just such a utility available. Here, we will guide you through the simple steps. Following them, you can convert self-hosted WordPress blogs to Blogger, as well as migrate from free WordPress to Blogspot.

There are some steps you have to follow !

Step 1 : Importing From WordPress

Login to your WordPress account (for free WordPress users), and the choose the blog you want to convert into Blogger. Alternatively, you can login to your Blog's Dashboard directly by adding the /wp-login.php  suffix to your blog's home URL (eg yourblog.com/wp-login.php or yourblog.wordpress.com/wp-login.php) .

Navigate through your WordPress menu, and find the Tools option. When you click on it, you'll see further options, among which you will see Export option. Click on it. Choose what to export, you can select Posts, Pages, or feedback, but it is recommended that you select all content to ensure maximum content is transferred. Then click on Download Export File, which will let you save the exported file to your hard drive. You have completed step 1 at this point.

Step 2 : Convert Into Blogger Format

There is a useful little app that will do this job for you. To convert, visit this app's page, and navigate to the button in the middle of the content that says 'Choose File'. Browse to the file you downloaded from WordPress, and upload it here. The click Convert. After the conversion, you will need to save the output file. this file is in Blogger-Friendly format, and will be used inside Blogger.

Step 3 : Import To Blogger

The import process into Blogger is pretty straightforward. Simply login to, or sign up for your Blogger Account, and click on Create a Blog link. I'm assuming you want to create a new blog for your new content. But if you want to, you can import into an existing blog as well.

From the Dashboard, click on Settings >> Other >> Import Blog.

Now, all you need to do is follow the simple instructions, and upload the converted file. You well be guided through a wizard that will import data from this file into Blogger. Once done, you will see all your posts from WordPress ready to be published !

Replace Content In Your Wordpress Using SQL

Like we all know, we can use SQL to replace or remove some content in our Wordpress using phpMyAdmin, on this i will show you How To Replace/Remove Content On Your Wordpress Using SQL. On this trick you can access through phpMyAdmin on your server or using plugin Wp-DBManager and you can direct access through Wordpress Admin panel.



After you install DB Manager or logging into phpMyAdmin, go to run SQL interface and do this code:

UPDATE wp_posts SET post_content = REPLACE ( post_content, 'nofollow ', '' );

On this sample, you will remove all content with nofollow on your post content. Please not you can multiple SQL query too by using this method:

UPDATE wp_posts SET post_content = REPLACE ( post_content, 'nofollow ', '' );
UPDATE wp_posts SET post_content = REPLACE ( post_content, ' nofollow', '' );

UPDATE wp_posts SET post_content = REPLACE ( post_content, ' rel="nofollow"', '' );

This method does the same thing but multiple queries are executed at the same time. You can tweak this code what ever you want, like replace wordpress.org with funisonline.blogspot.com, so all your content with url's to wordpress.org will be replaced into funisonline.blogspot.com using this method.

UPDATE wp_posts SET post_content = REPLACE ( post_content, 'wordpress.org ', 'funisonline.blogspot.com' );

That's all, i hope our tutorial replace or remove content on your Wordpress using SQL worked for you.

How To Display Any External RSS Feed On Your Site

Have you seen other bloggers who display their other blog's feed on their site. You want to do it too for extra promotion and traffic. Well here is the tutorial for you. Simply paste the following code in anywhere in your theme.



<?php include_once(ABSPATH.WPINC.'/feed.php');
$rss = fetch_feed('http://feeds.feedburner.com/funisonline');
$maxitems = $rss->get_item_quantity(5);
$rss_items = $rss->get_items(0, $maxitems);
?>
<ul>
<?php if ($maxitems == 0) echo '<li>No items.</li>';
else
// Loop through each feed item and display each item as a hyperlink.
foreach ( $rss_items as $item ) : ?>
<li>
<a href='<?php echo $item->get_permalink(); ?>'
title='<?php echo 'Posted '.$item->get_date('j F Y | g:i a'); ?>'>
<?php echo $item->get_title(); ?></a>
</li>
<?php endforeach; ?>
</ul>

How To Create A Page That Shows Random Posts In Wordpress

Have you even been to a site and saw this cool feature ? They have a link in their top navigation to something like Stumble ! or Read Random Articles, or some other creative text. Each time you refresh, you are delivered with a new post. Well this trick is just for you then.



You would need to follow the trick # 1 in this post to create a custom page template, and simply paste this code in there:

"<?php
    query_posts(array('orderby' => 'rand', 'showposts' => 1));
    if (have_posts()) :
    while (have_posts()) : the_post(); ?>

    <h1><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h1>

    <?php the_content(); ?>

    <?php endwhile;
    endif; ?> "

This is a simple Wordpress loop that is running a query to display random posts and the number 1 in there is telling Wordpress to only show 1 post. You can change that number, but most of the time people do it one post a time.

How To Use JQuery To Manage Wordpress Sidebars

How To Use JQuery To Manage Wordpress Sidebars ?

Today i will tell you that how we can use JQuery to manage wordpress sidebars, recently i finished a work that pushed Wordpress farther than i have ever before. Essentially, each of the 18 categories was a micro-site with its own stylish and two widgetized areas.

That means 36 different widgetized sections !

When viewing the Widget page in the Wordpress Dashboard, the list of widget areas extend quite a bit below the fold. This made adding and managing the widgets extremely cumbersome. The obvious solution was to display only one widget area at a time.

Before writing any code, i like to flesh out the basics to may solution on paper. Some simple brainstorming lead me to the following goals.

  • Create an array of all the widget areas available.

  • Hide all the listed widget areas besides the first.

  • Insert into the widget page a drop-drown box containing a list of the widget areas in our array.

  • Whenever a user selects a widget area from the drop-down box, show that one and hide the rest.


We'll begin by creating file named widget-admin.js. Save this file somewhere in your theme directory. I prefer to keep all my JavaScript files in the js/sub-directory. We only want this code to be loaded if we are on the widgets page of the Wordpress Dashboard. To achieve this, add the following code to your function.php file.
// Custom Admin Sidebar Switcher
function sidebar_switcher() {
global $pagenow;

if ($pagenow == 'widgets.php')
wp_enqueue_script('fca_admin', get_bloginfo('template_url').'/js/widget-admin.js');
}
add_action('admin_print_scripts', 'sidebar_switcher');

By latching onto Wordpress's admin_print_scripts hook, our sidebar_switcher () function will only be run when we are in the dashboard. The sidebar_switcher () function checks if we are on the widget page. If we are, it tells Wordpress to queue up or widget-admin.js file.

The following code goes into the widget-admin.js that we created earlier. The comments should make it self-explanatory.
jQuery("document").ready(function(){
var sidebars = new Array(); // Create array to hold our list of widget areas
var selectorHTML, name; // Declaring variables isn't necessary in JavaScript, but it's good practice

jQuery('.widget-liquid-right .sidebar-name h3').each(function(index) {
name = jQuery(this).html(); // Get the name of each widget area
name = name.replace(/\s*<span>.*<\/span>/,''); // Remove extra <span> block from name
sidebars.push(name); // Add the name to our array
});

jQuery('.widget-liquid-right .widgets-holder-wrap').hide(); // Hide all the widget areas in list
jQuery('.widget-liquid-right .widgets-holder-wrap:first').show(); // Show the first

// Start <select> block. Position to the right of the "Widgets" heading.
selectorHTML = "<select id=\"sidebarSelector\" style=\"position: absolute; left: 400px; top: 68px;\">\n";

var count = 0;
for ( var i in sidebars ) // Add option for each widgetized area
selectorHTML = selectorHTML + "<option value=\"" + count++ + "\">" + sidebars[i] + "</option>\n"; // Store the index of the widget area in the 'value' attribute

selectorHTML = selectorHTML + "</select>"; // Close the <select> block

jQuery('div.wrap').append(selectorHTML); // Insert it into the DOM

jQuery('#sidebarSelector').change(function(){ // When the user selects something from the select box...
index = jQuery(this).val(); // Figure out which one they chose
jQuery('.widget-liquid-right .widgets-holder-wrap').hide(); // Hide all the widget areas
jQuery('.widget-liquid-right .widgets-holder-wrap:eq(' + index + ')').show(); // And show only the corresponding one
});
});

How To Create An Effective 404 Page In Wordpress

How To Create An Effective 404 Page In Wordpress :

The page you often see when clicking on any link saying "404 Error" or "Page not Found" or "Page cannot be displayed" etc, is basically a 404 Error Page. Its like a dead-end for your user. Which can lead to exit of website surfing and obviously no one wants to see his visitor leave like that. So here are some tips to get the best out of the 404 Page.

Giving useful links and information on a 404 page can help your user stay and go more around your website or blog.

Create a 404.php page in your theme folder if you don't have already. You can use any styles and HTML tags you want, to fit your needs. But try using the same design structure that of Blog, so the page looks like its also part of the website.

Make sure you have these basic PHP Codes in your 404 file. The easy way is to follow the Custom Page Template Tutorial to create 404 page and insert content as u like it.

<?php get_header ( ) ; ?>

<?php get_sidebar ( ) ; ?>

<?php get_footer ( ) ; ?>

Some Useful Tags You May Want To Use :

Here are some tags that you can use.

Display Archive By Months :

<?php wp_get_archives('type=monthly');?>

This code will display archive by months, but it will list all months. So it might become mess if you have a blog that is three years old.

Display List Of Categories :

<?php wp_list_cats(); ?>

This code will list all categories on your blog. Ofcourse you can style them however using list tags or others. To exclude any category such as "Uncategorized" follow this tutorial.

Display Most Used Tags :

<?php wp_tag_cloud('smallest=8&largest=12&unit=pt&number=30&format=list&order=RAND');?>

This will show the most used tags in a cloud form.

Display Recent Posts :

<?php get_archives('postbypost','17','custom','<li>','</li>');?>

This brings the most recent posts written on your website or blog.

There are too many tags you can use but here are some most important or should say finest ones !

How To Display An External RSS Feed On Your Site

 

How To Display An External RSS Feed On Your Site

How To Display An External RSS Feed On Your Site

Have you seen other bloggers who display their own blog's feed on their site. You want to do it too for extra promotion and traffic. Well here is tutorial for you. Simply paste the following code in anywhere in your theme.

<?php include_once(ABSPATH.WPINC.'/feed.php');
$rss = fetch_feed('http://feeds.feedburner.com/pkchatmaza');
$maxitems = $rss->get_item_quantity(5);
$rss_items = $rss->get_items(0, $maxitems);
?>
<ul>
<?php if ($maxitems == 0) echo '<li>No items.</li>';
else
// Loop through each feed item and display each item as a hyperlink.
foreach ( $rss_items as $item ) : ?>
<li>
<a href='<?php echo $item->get_permalink(); ?>'
title='<?php echo 'Posted '.$item->get_date('j F Y | g:i a'); ?>'>
<?php echo $item->get_title(); ?></a>
</li>
<?php endforeach; ?>
</ul>


 

How To Create A Page That Shows Random Posts

How To Create A Page That Shows Random Posts

Have you ever been to a site and saw this cool feature ? They have a link in their top navigation to something like Stumble, or Read random articles, or some other creative text. When you click on that link, it takes you to the page that one random page. Each time you refresh, you are delivered with a new post. Well this trick is just for you then.

You will need to follow the trick # 1 in this article to create a custom page template. And simply paste this code into there.

<?php
query_posts(array('orderby' => 'rand', 'showposts' => 1));
if (have_posts()) :
while (have_posts()) : the_post(); ?>

<h1><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h1>

<?php the_content(); ?>

<?php endwhile;
endif; ?>


This a simple wordpress loop that is running in a query to display random posts and the number 1 in there is telling wordpress to only show 1 post. You can change that number, but most of the time people do it one post a time.