Get fields from metabox array
Use get_post_custom, it will return an array of all the posts meta info. http://codex.wordpress.org/Function_Reference/get_post_custom
Use get_post_custom, it will return an array of all the posts meta info. http://codex.wordpress.org/Function_Reference/get_post_custom
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
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
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
The version is the version of your own script, and is appended to the filename in the src attribute of the script tag. This is so you can employ long-term caching on the client-side and still insure a new version of your script will be fetched from the server rather than local cache if you … Read more
The insideds of a function is separated from the global things. Therefore the variables, set by other processes are not reachable/useable inside a function until you made them so, with, for example global keyword for a var. So Add the_post(); after the function’s {, or add global $post; and use $post->ID instead of the_ID and … Read more
I think you need to use update_user_meta(), I may be misunderstanding what you’re trying to do though. EDIT (doesn’t work): add_action( ‘user_register’, ‘my_save_extra_fields’ ); function my_save_extra_fields( $user_id ) { update_user_meta( $user_id, ‘deposit’, 5 ); } EDIT: WORKING SOLUTION: add_action( ‘user_register’, ‘my_save_extra_fields’ ); function my_save_extra_fields( $user_id ) { global $wpdb; $cash=5; $wpdb->update( $wpdb->users, array(‘deposit’ => $cash), … Read more
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
Your function is going to hit the end of that first return and stop. Concatenate the strings and it should start working.
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