2 Methods to show wordpress lastest posts at other site

Method one, we can show other wordpress posts at our site by using  simplepie.inc, download a wordpress plugin, named “simplepie-core”, and upload simplepie.inc to your site root, you can rename simplepie.inc to other name also, ie, eyeglassframes.inc. Then add the following code at your own site .php file.

Problem with cURL and PHP Output Buffering while installing zen cart

When we install zen cart under XAMPP, we often meet two issues: ATTENTION: Problems Found CURL not compiled into PHP – notify server administrator more info… CURL not compiled into PHP – notify server administrator more info… CURL not compiled into PHP – notify server administrator more info… CURL not compiled into PHP – notify […]

How to change wordpress post author name?

Sometimes we want to change wordpress posts author name, if you only need to change several posts, and you do not know the skills, you can delete and repost with the new author name. If you need to modify hundreds posts with the same author, how to do then?

How to display wordpress posts outside the blog?

For example, your main site is http://www.glassespeople.com ,and your blog is http://www.glassespeople.com/blog. If you want so 5 latest post description at www.glassespeople.com, how to do? Simple, the following code will meet your needs: // Include WordPress define(‘WP_USE_THEMES’, false); require(‘blog/wp-load.php’); query_posts(‘showposts=5’); ?> <?php while (have_posts()): the_post(); ?> <h2><?php the_title(); ?></h2> <?php the_excerpt(); ?> <p><a href=”<?php the_permalink(); […]

Display Domain Name

How would I display the domain name of the page I am at. Lets say it it http://www.eyeglasseshut.com/comfortable-prescription-eyeglasses.htm and I want to display desilva.biz. Exactly like that. No www, or http:// included. In fact, it is very use to let PHP do such thing: $hostname = $_SERVER[‘SERVER_NAME’]; $hostname = str_replace(‘www.’, ”, $hostname); echo $hostname;

How to add 10 hot wordpress posts

If you want to add 10 host post at your right bar, just copy and past the following code: <h2>Hot PHP Posts</h2> <ul> <?php $result = $wpdb->get_results(“SELECT comment_count,ID,post_title FROM $wpdb->posts ORDER BY comment_count DESC LIMIT 0 , 10″); foreach ($result as $post) { setup_postdata($post); $postid = $post->ID; $title = $post->post_title; $commentcount = $post->comment_count; if ($commentcount […]

Using PHP to Generate Strong Password

If you want to have very strong password to protect your account, here is the code for : <code> <?php   function generatePassword($length=9, $strength=0) {     $vowels = ‘aeuy’;     $consonants = ‘bdghjmnpqrstvz’;     if ($strength & 1) {         $consonants .= ‘BDGHJLMNPQRSTVWXZ’;     }     if ($strength & 2) {         $vowels .= “AEUY”; […]

How to control WordPress 9.2 tag cloud font size?

We all know that WP has added widget_tag_cloud_args filter, you can use this function to override the default arguments that are passed to the wp_tag_cloud function to change the tag cloud font size you like. This filter provides a keyed array, where the smallest, largest, and unit keys represent the smallest font size, the largest […]

Easy way do delete files from cpanel

Sometimes we need to empty all files under a web hosting, how to do then?  Very simple, just login your cpanel, click “File Manager” and choose “public_html”, del  “public_html” and rebuild a new one. That’s it! Very easy, right!  Somebody may ask how to del part of the files, also very easy. Go to  “public_html”, and […]

Custom content to a specific category page of X-cart

When we go to a specific x-cart category, we can put there some custom content above the category thumbnails. We need to modify skin1/customer/main/subcategories.tpl and just after the h1 tag (or any other place we want it to show) {if $current_category.category eq “100”}show cusotm contents, prescription glasses{/if} {if $current_category.category eq “200”}show cusotm contents, men’s glasses{/if} […]