RSS Feed in Custom Field
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);
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
This is no solution, just an explanation: WordPress currently doesn’t have taxonomy meta data. You could add a stand alone table to add meta data there. Anyway, it’s not recommended to add your taxonomy/category/tag meta data to the options table as this one wasn’t made to get JOINed to do meta queries by it. My … 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
Try this: <?php $description = get_post_meta( $post->ID, ‘page-description’, true ); ?> <div id=”page-title”> <?php if( $description !=” ) { ?> <p><?php echo $description; ?></p> <?php } ?>
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
I know how to do that in pure SQL but I can’t get WP_Query to nest conditions in the way required. If it is acceptable, the easiest way to make this work would be to assign an arbitrary far future end date when the data is saved to the database. Something like strtotime(“2038-01-01”). That is … Read more