Automatically add a character to field in edit post page

Here is one idea: You could try to fire the change event of the #location-address (for example) input text field when the page has loaded: function custom_jquery() { echo “<script>jQuery(document).ready(function(){ jQuery(‘#location-address’).on( ‘change’, function( event ) { console.log(‘debug: on change fired!’); }); jQuery(‘#location-address’).change(); });</script>”; } add_action( ‘admin_head-post.php’, ‘custom_jquery’ ); if your editing page is post.php. You … Read more

If tag exists, then echo once

I’m not sure what you want, but if you are trying to get a unique <li>-list from the query you can try (untested): <?php // LOOP ARGUMENTS $args = array( ‘post_type’ => ‘xyz_members’, ‘posts_per_page’ => -1, ‘orderby’ => ‘title’, ‘order’ => ‘ASC’, ‘tax_query’ => array(array(‘taxonomy’ => ‘member_types’,’field’ => ‘slug’,’terms’ => ‘current-class’,’operator’ => ‘NOT IN’))); $loop … Read more

Help on Custom Post Types

You want Posts 2 Posts which allows you to create many to many (or one to many or many to one) relationships between post objects — including custom post types. To related stores and deals you might do something like this… <?php add_action(‘p2p_init’, ‘wpse102461_connection’); function wpse102461_connection() { p2p_register_connection_type(array( ‘name’ => ‘stores_to_deals’, ‘from’ => ‘STORES’, // … Read more

If custom taxonomy else conditional [closed]

For custom post types use is_post_type_archive(‘tips’). Let us know if this works. It should also work with an array is_post_type_archive( array( ‘tips’, ‘cpt’, ‘another cpt’ ) ) I am currently using this function to recognize specific post type archives. See: A Post Type Archive in codex. It would be best if you could specify which … Read more