WordPress Comment functions

I do hope I understand what you’re asking, as you’re not giving much information. From what I specifically to customize the output of your comments. Well, there partially is. The wp_list_comments accepts a callback argument among several others. This callback allows you to run a custom function; in your case, a custom function to manipulate … Read more

Changing functions.php and .htaccess files

functions.php file is where you can do wonders with your theme without touching the core WordPress files. Most of the time the backup functions.php trick would work for you unless you aren’t changing anything in the database with any of your action or filter hooks. You could check this link too -> http://codex.wordpress.org/Theme_Development#Functions_File Regarding the … Read more

Echo custom field value in shortcode function

Try this code, I’ve removed query_posts and used get_posts instead because I’m not sure if query_posts will work in a shortcode and using get_posts is safer. function featured() { $posts = get_posts(array(‘post_type’ => ‘property’, ‘posts_per_page’ => 2)); if(isset($posts) && !empty($posts)) { foreach($posts as $post) { echo “<div class=\”singlefeatured group\”>”; //I wasn’t sure what you wanted … Read more

Add title & subtitle to shortcodes

function spoiler( $atts, $content = NULL ) { extract( shortcode_atts( array( ‘title’ => ‘default title’, ‘subtitle’ => ‘default subtitle’, ), $atts ) ); return ‘<div class=”moreinfo”><h3 class=”click drop subtitle”>’ .’Title:’.$title.’Subtitle:’.$subtitle. ‘</h3><div class=”morecontent”><p>’ .$content. ‘</p></div><!–/.morecontent–></div><!–/.moreinfo–>’; } add_shortcode( ‘spoiler’, ‘spoiler’ ); //[spoiler title=”title” subtitle=”subtitle”]content[/spoiler] Docs: add_shortcode, extract That should allow you to display the title and subtitle … Read more

How to Insert A List of Posts in A Category Written by the Author into the Author Archive

Not the most efficient way but it works, put this in your theme’s functions.php function author_post_breakdown($author_id){ //get all post of this author $n = get_posts(array( ‘author’ => $author_id, ‘posts_per_page’ => -1, ‘fields’ => ‘ids’ ) ); $cats= array(); //loop over all post of this author and get the categories for each post foreach((array)$n as $id){ … Read more