Custom fields driven site. I want to make a visual editor driven page template. How?
Use advanced custom field plugin download here You can easily map custom field groups to set of pages, posts , post types, taxonomies etc.
Use advanced custom field plugin download here You can easily map custom field groups to set of pages, posts , post types, taxonomies etc.
It most probably means that no custom post values have been retrieved for the key Description that you used. According to the Codex, Returns nothing if no such key exists, or none is entered. Try adding print_r($key_values); on the line just after get_post_custom_values(“Description”); and check if any value is retrieved. To skip this warning(when you … Read more
Try using character entities: [ and ] for left and right square brackets, respectively.
You might be able to put this into your template wherever you want to display the RSS custom field: get_post_meta($post->ID, ‘custom field name’, true);
This is possible by using AJAX. The following links are containing more information about AJAX and implementation in WordPress: http://codex.wordpress.org/AJAX Ajax (Asynchronous JavaScript And XML) is a technology that allows a web page to perform actions or update dynamically, without completely reloading http://codex.wordpress.org/AJAX_in_Plugins This article, aimed at plugin developers, describes how to add Ajax http://wpmu.org/how-to-use-ajax-with-php-on-your-wp-site-without-a-plugin/ … Read more
On an “author” page you can get a lot of the information you need with get_queried_object and additional information with get_user_meta. What you want (sounds like) should be in that second chunk of information.That is… $author = $wp_query->get_queried_object(); $ameta = get_user_meta($author->ID); var_dump($author,$ameta); // debugging if(!empty($ameta[‘facebook’])) { var_dump($ameta[‘yim’]); // debugging } // and so one for … Read more
I went through all this yesterday! According to the codex there must be a post id given to current_user_can to check ‘edit_post’, so your capability check should be: if( !current_user_can( ‘edit_post’, $post_id ) ) return; Also, your final two lines should be more like this: $chk = isset( $_REQUEST[‘page_title_off’] ) ? ‘on’ : ‘off’; update_post_meta( … Read more
It can be achieved by scheduling the post time to current time + a few seconds for example. Each time you add a custom field, just before saving – change the publish time to the current time and then save.
After much reading, i realized that it would be more easily done using the WordPress API, so i baked out this little script. Simply add it to your theme’s functions.php then run it once. When done, remove it. function convertGalleries($test){ $galleries = get_posts(array( ‘meta_key’ => ‘custom_post_template’, ‘post_status’ => array( ‘any’ ),’posts_per_page’=>-1 )); if($test){ return count($galleries); … Read more
If you need sorted result by default,you need to query with sort parameters see https://codex.wordpress.org/Class_Reference/WP_Query#Order_.26_Orderby_Parameters more more (example from the codes) $query = new WP_Query( array ( ‘post_type’ => ‘product’, ‘orderby’ => ‘meta_value’, ‘meta_key’ => ‘price’ ) ); Alternatively, you could also easily do the sorting using jquery plugins like tinysort ( see http://tinysort.sjeiti.com/ ) … Read more