Add a label to the editor?
I recently used this in one of the projects, so here you go add_action( ‘edit_form_after_title’, ‘wp692_edit_form_after_title’ ); function wp692_edit_form_after_title() { echo ‘<h2>This is My Label!</h2>’; }
I recently used this in one of the projects, so here you go add_action( ‘edit_form_after_title’, ‘wp692_edit_form_after_title’ ); function wp692_edit_form_after_title() { echo ‘<h2>This is My Label!</h2>’; }
As you’ve already get results with tag I’m going to give suggestion only for address and rating. For your current situation, the best option is to use WordPress post meta to store these values. Then you can use meta query to retrieve those posts. $args = array( ‘post_type’ => ‘hotel’, ‘meta_query’ => array( array( ‘key’ … Read more
I did similar thing recently but used the wp.media instead of ThickBox https://codex.wordpress.org/Javascript_Reference/wp.media with the same code from Codex. The only thing to make it work with multiple inputs is to move the frame variable from global scope to click function, so the ‘frame’ will be fresh for each click.
pre_get_posts does not work on page templates and static front pages. It will 404. If I read the WP_Query class correctly, the page ID is passed to a parameter such as p once the URL is parsed. You can try unsetting this parameter and check if it changes the query, but I doubt if this … Read more
After hours and hours I finally figured it out. I only had to replace wp_reset_postdata(); with $cust_loop->reset_postdata();
Create single-yourcostomposttypename.php file in theme folder.
So I figured out, that my theme was not designed to handle custom post types (at least not via the archive). The solution was to edit the code as shown below. Comments inserted where changes were made: function pmc_breadcrumb($title = false) { global $pmc_data; $breadcrumb = ”; if (!is_home()) { if($title == false){ $breadcrumb .= … Read more
This can be very well achieved using Advance Custom Field (ACF) plugin. In your header image post type I suggest you also add support for title so that you can easily identify the header images in the listing. For that you just need to update ‘supports’ => array(‘title’,’thumbnail’) As for your main question of assigning … Read more
You have a few issues here remove_filter( current_filter(), __FUNCTION__ ) is used in wrong context here for what you need to do. remove_filter() unsets the filter from the GLOBALS array once the filter has run once, so your filter is removed after the first run. This happens with spaghetti functions. You should always return the … Read more
Piter is right, don’t use query_posts. You could do something like: $paged = ( get_query_var(‘paged’) ) ? get_query_var(‘paged’) : 1; $args = array( ‘post_type’ => ‘properties’, ‘meta_key’ => ‘pd_city’, ‘orderby’ => ‘meta_value’, ‘order’ => ‘ASC’, ‘posts_per_page’ => 5, ‘paged’ => $paged ); $query = new WP_Query( $args ); Just make sure you have the values … Read more