How to Change the “page” slug in Pagination of WordPress?

When pagination of www.cheapglasses123.com/blog is activated, the pagination URL will display as “www.cheapglasses123.com/blog/page/2” as default. How can we change the pagination to “cheapglasses123.com/blog/eyeglasses/2”? (more…)

Posted in WordPress. Comments Off on How to Change the “page” slug in Pagination of WordPress? »

How to Let X-Cart Display latest WordPress Posts?

This mod assumes that you use the WordPress blogging software and uses the same database as your xcart software.
If your wordpress and x-cart use separate database then use this code for blog_headlines.php (more…)

Posted in MySQL, Php Code, WordPress, X-Cart. Comments Off on How to Let X-Cart Display latest WordPress Posts? »

Adding custom text to bottom of all posts in particular category

If we want to add the same piece of custom text to the bottom of every post in a certain category of wordpress. How do then?
For example, we want to add “Good idea if you buy eyeglasses online!” at each page of category which category id is 2.

Try to add the following code in your theme’s functions.php: (more…)

Posted in WordPress. Comments Off on Adding custom text to bottom of all posts in particular category »

Let WordPress Different Category Shows Different Style

For example, we are designing a company site using wordpress, 2 categoris: product category, and new category. How to let these 2 categories show different styles?

Creat 2 php files: product.php, news.php, and copy all contents from wp-content/themes/zeecompany/archive.php;
Edit wp-content/themes/zeecompany/archive.php, delete all contents in archive.php, and copy the following code in archive.php: (more…)

Posted in WordPress. Comments Off on Let WordPress Different Category Shows Different Style »

WordPress Twenty Twelve change Continue reading to post title

The default template of Twenty Twelve shows “Continue reading” at homepage, or category page. How to change “Continue reading” to post title?

Edit content.php, this file is just under the template of “Twenty Twelve”, find the following code:

<?php the_content( __( 'Continue reading <span>&rarr;</span>', 'twentytwelve' ) ); ?>

and change it to:

  <?php the_content( __( 'Continue reading [' . get_the_title($post->ID) . '] <span>?</span>', 'twentytwelve' ) ); ?>

Posted in WordPress. Comments Off on WordPress Twenty Twelve change Continue reading to post title »

Remove Any Unnecessary Files of WordPress

How can we remove the /wp-includes/js/comment-reply.js?ver=20090102 script tag?
2 steps:

first edit wp-includes/functions.php, add the follow code at the end of functions.php:
function clean_header(){
wp_deregister_script( 'comment-reply' );
}

second, edit wp-includes/default-filters.php, add the next line at proper place:
add_action('init','clean_header');

Posted in WordPress. Comments Off on Remove Any Unnecessary Files of WordPress »

WordPress 3.5 Plugin Update Errors

I have a blog installed under xampp, and I am using windows 7 system. Today I updated my wordpress based blog to wordpress 3.5. There are some errors, all about wordpress plug-in.

I met the following errors:

Updating Plugin Akismet

Downloading update from http://downloads.wordpress.org/plugin/akismet.2.5.7.zip…

An error occurred while updating Akismet: Download failed. Could not open handle for fopen() to http://downloads.wordpress.org/plugin/akismet.2.5.7.zip.
(more…)

Posted in WordPress. Comments Off on WordPress 3.5 Plugin Update Errors »

2 SEO Skills on WordPress

Here let me share 2 skills on wordpress seo. The default method of a post read more is usally shows as “read more…”, or “Continue reading”. This is very bad for our seo purpose. We all know that we’d bette use our keywords as text link or at least the text link should contain our main keywords.  How to do then? We can use each post title instead “read more…” as default text link. (more…)

Posted in WordPress. Comments Off on 2 SEO Skills on WordPress »

How to Get URL of Current WordPress Page or Post?

We often need to know how to get url of current wordpress page or post if we re-programming wordpress. Here I will share 2 methods with you. One is via PHP code, and the other is using wordpress function.

First, let me intruduce how to use PHP to achieve our demands. We can add the code to suitable pages, say footer.php. Go to your wordpress template, and edit footer.php. Here we use http://kingphp.com/15.html as an example. (more…)

Posted in Php Skills, WordPress. Comments Off on How to Get URL of Current WordPress Page or Post? »

How to WordPress Show Latest Posts under Certain Category?

Sometimes we need to modify wordpress templates to meet our demands, for example, we need to show latest posts under certain category only, say category id is 11. How to do then? Here is the code I have used for www.xuyi365.org

<?php query_posts('showposts=5&cat=29'); while(have_posts()) : the_post(); ?> <ul> <li><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></li> </ul> <?php endwhile;?>

I have add the above code for www.xuyi365.org right bar, the complete code is:

<aside id="categories-3"><div><h3>Housing News</h3><div></div></div>  <?php query_posts('showposts=5&cat=29'); while(have_posts()) : the_post(); ?> <ul> <li><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></li> </ul> <?php endwhile;?> </aside>

The code will show 5 lates posts under category 29.

Posted in WordPress. Comments Off on How to WordPress Show Latest Posts under Certain Category? »
King Php Science Welcome, you are from: 54.224.158.232