Problem in replacing the_content with the_excerpt()

Are you sure you have replaced it in the correct template file? I found a useful way to tell by adding this to the functions.php file: <?php add_action( ‘wp_head’, ‘adminbar_print_template’ ); function adminbar_print_template() { global $template, $current_user, $wp_admin_bar; get_currentuserinfo(); /* If you have more than one user deny. Be sure to use your user ID! … Read more

Writing a link cloaking plugin

I don’t see why the same method can’t still work in a WordPress site. If you specifically specify a file to link to that is a valid PHP file, available on your server, then it will still hit that file instead of hitting WordPress. If you are having issues with this working, make sure you … Read more

Explode() expects a string

Let’s start from the top: $current = get_the_category(); This returns an array of objects, one object for each category. $current_id= $current[0] ->cat_ID; This returns an object, the first object in the previous array $categs_list = get_category_parents($current_id); This returns a string, but only if the current category has parents; otherwise, it returns whatever was passed to … Read more

WordPress sitemap with Custom Post Types

Here is a quick crack at it, which should work in two level depth: <h2 id=”posts”>My Post Type</h2> <ul> <?php $not_in = array(); //to avoid naming the same post over and over //get top level terms $Parent_terms = get_terms( ‘my_taxonomy’, array(‘orderby’ => ‘name’,’parent’ => 0)); foreach ($Parent_terms as $term) { echo “<li><h3>”.$term->name.”</h3>”; echo “<ul>”; //get … Read more