September 24th, 2009 by admin0
I had come through a situation to compare the category name and post title for a wordpress post. The following functions and code helped me to do this.
$category = get_the_category();
$cat = $category[0]->cat_name;
$post_no = get_post($post);
$title = $post_no->post_title;
$match=strcmp($cat,$title);
if($match==0){
echo “match”;
}
else
{
echo “no match”;
}
The problem here is $cat = $category[0]->cat_name; returns the first category name, so we are comparing only [...]
«« Read More
August 24th, 2009 by admin0
Just now, I had been in a horrible situation that I can see all my blog pages but when I go to http://worth2read.org/blog/wp-admin/ it appears as blank. That is I am completly locked out of the admin area.
I made a Google search for the solution and confused with lots of solutions that appeared.
However atlast I [...]
«« Read More
August 15th, 2009 by admin0
We can add new widgets by using functions.php in the theme folder.
For example I can add “Services I offer and Google Adsense in 2 ways
to the sidebars.
1. Code both to the page sidebar.php
3. Create widgets using functions.php file in the theme folder
Following code shows how I added a simple Adsense widget using functions.php
if (function_exists(’register_sidebar’))
{
register_sidebar_widget(__(’Adsense’), ‘google_widget’);
}
function [...]
«« Read More
August 8th, 2009 by admin0
In most of the themes the post container lists all the excerpts of the most recent posts in the home page. The following code will help you to break up each post into separate boxes.
Example: Theme Home page Preview
Using css we can make a 10px gap in-between each post, where the background of the page [...]
«« Read More
July 25th, 2009 by admin0
Well, I have to go through a situation as follows…
The blog is installed in the subdirectory of a website, like I have done for this site..
But in the sidebar of the index page in the main site, the excerpts of blog posts need to appear…
The following code helped me to do it…
«« Read More
January 31st, 2009 by admin0
The outdated version of migrate.php is already available. I had just updated it so that we can use it for the latest version. Only some field names, table names etc are changed.
Step 1: Upload the wordpress files to the b2evolution directory (This is to keep permanent link as same)
Step2: Install wordpress, Use the same database [...]
«« Read More