Mass Delete Comments from WordPress

Pending links, Spam links, or Trash links with a WordPress powered blog can grow really quickly and most is spam. Word Press allows you to remove such comments but only 20 at a time. What if you have thousands pending links, spam links or trash links need to be deleted? You will wast a lot time if you delete them via WordPress Blog own functions. Here we will teach you how to delete them via phpmyadmin! (more…)

Posted in Php Code, WordPress. Comments Off on Mass Delete Comments from WordPress »

explode and foreach to show strings or ASCII

//transfer ASCII to string

$string = “78b101b116b87b105b110b100”;
$tags = explode(‘b’, $string); 
foreach($tags as $key) { echo chr($key);  }
//transfer string toASCII
echo “<br><br>”;
$string = “Tiger Young”;
foreach($tags as $key) { echo ord($key).”b”;  }
echo “<br><br>”;

Posted in Php Functions, Php Skills. Comments Off on explode and foreach to show strings or ASCII »

wp-includes\taxonomy.php on line 1518

I am using XAMPP, and wordpress 3.0.4, today when I want to show all post, the following error message shows:

Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 32768 bytes) in D:\xampp\htdocs\wp\specsexpert\wp-includes\taxonomy.php on line 1518 (more…)

Posted in Apache, WordPress. Comments Off on wp-includes\taxonomy.php on line 1518 »

WordPress Ad Code Skills

Sometimes we want our ads codes show differently at our wordpress blog. Say we want to show adsense codes different types at different place, say homepage, single post. Simple!

The following code will show your ad code one at single post and single page, and ad code two at other places: (more…)

Posted in WordPress. Comments Off on WordPress Ad Code Skills »

Old domain to new domain – different accounts

We can use the following code, and paste them in .htacess file:

Options +FollowSymlinks
RewriteEngine On
RewriteCond %{HTTP_HOST} ^old-domain.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.old-domain.com$
RewriteRule (.*)$ http://www.new-domain.com/$1 [R=301,L] (more…)

Posted in Apache. Comments Off on Old domain to new domain – different accounts »

Category ID from current URL nicename and show some posts name

We can use the following code to get category ID from current URL nicename:
We can use the following code to get category ID from current URL nicename:
<?php
if(is_category() || is_single()){
 $category = end(get_the_category());
 $current =$category->cat_ID;
 $current_name = $category->cat_name;
}
echo $current_name . ” has id “.$current.” and is called “.$current_name;
;
?> (more…)

Posted in WordPress. Comments Off on Category ID from current URL nicename and show some posts name »

Show title at wordpress more tag

If we use the default wordpress more tag, then all posts will show a link with the word “more”, it is not so good for seo, because all the link words are the same: More, but they link to different pages with different content.

We can modify certain code to inforce wordpress “more” tag, we can add post title with more tag. There are two methods: (more…)

Posted in WordPress. Comments Off on Show title at wordpress more tag »

How to let non-www redirect to www domain?

Today I installed DEDECMS, a very popular PHP CMS open source system, I found I can not let non-www redirect to www domain. Say my domain is glassespeope.com, then I can not let http://glassespeople.com redirects to http://www.glassespeople.com. I tried to google, and found the following code can resovle the problems:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^glassespeople.com
RewriteRule (.*) http://www.glassespeople.com/$1 [R=301,L]

Save the above code in a .htaccess file, and upload this .htaccess to your web hosting root. Everything is OK!

Posted in Apache. Comments Off on How to let non-www redirect to www domain? »

How to use WordPress to design company site?

As we know that WordPress is very powerful, and Google likes it very much. If you can always publish quality contents for some months, I am sure Google will love your blog very much, and Google will index your new articles in minutes. That’s why more and more company come to use WordPress to design their business sites. (more…)

Posted in WordPress. Comments Off on How to use WordPress to design company site? »

How to Access MySQL Command Line in XAMPP?

MySQL binaries should be under your XAMPP folder. Look for a /bin folder, and you’ll find the mysql.exe client around. Let’s assume it is in e:\xampp\mysql\bin, then you should fireup a command prompt in this folder.

First, go to e:\xampp, and run xampp_start. If you do not run xampp_start first, the error message “Can’t connect to Mysql server on ‘localhost'” will occur when you go to step 2.

Afer you run the commend prompt of DOS, then enter:

cd d:\xampp\mysql\bin
mysql.exe -u root –password

Enter password:
and enter root password

mysql>

After log into your mysql server, and start typing your commands.
Type “quit”  or “exit” to exit mysql
(more…)

Posted in Php Study. Comments Off on How to Access MySQL Command Line in XAMPP? »
King Php Science Designed by:KingPhp.com Welcome, you are from: 54.146.11.8