New answers tagged

0

I would definitely recommend the Custom Post Type route. You will have two issues: How to automatically add new properties when the XML is updated. How to update existing property values if they change (e.g., House A has a price increase after the initial import). To solve the first, you can set up a WordPress cron that will hook into your import action....


0

I've spent an hour searching for a solution and there was nothing that works so I had to write the solution on my own. It is tested and working with Wordpress 5.3.1 and is the only solution that solves this problem I could find on the internet. Place the following code in your functions.php file to hook into posts_clauses filter. /** * Include meta ...


1

You have to also fetch the value in href attribute as wel. Currently there are static value you have added. when you change value from backend it just display but when you click it will consider tel: and mail: attribute value. So change code as below: Phone: <a href="tel:<?php echo get_post_meta( $post->ID, 'telNo', true );?>"><?php echo ...


1

So finally I found a way to do that. Here is the code. page-contact.php <!-- Contact Info --> <div class="contact-info col-md-4 col-sm-4 margin-top-20 padding-left-20"> <label class="contact-label pull-left width-wide">Contact Info</label> <p><strong>...


1

You have to remove if($post_slug != $post->post_type){} from save function or change $post_slug = "book"; to $post_slug = "page";. because it check $post slug is book or not. currently post type is page for contact us page. and you have set as book add_action("save_post" , "wpl_owt_save_metabox_data" , 10 , 2); function wpl_owt_save_metabox_data($...


0

If you want to save your Tune Category as deafult category, you have to use wp_set_post_terms() with update_post_meta(). add_action( 'save_post', 'rudr_save_metaboxdata', 10, 2 ); function rudr_save_metaboxdata( $post_id, $post ) { if ( defined('DOING_AUTOSAVE') && DOING_AUTOSAVE ) return $post_id; // if post type is different from our ...


1

First of all you saved the the terms value in a post meta table and not following the wordpress conventional method. To make it connect with default category with that post you need to modify your save_post action. Check the modified code. add_action( 'save_post', 'rudr_save_metaboxdata', 10, 2 ); function rudr_save_metaboxdata( $post_id, $post ) { ...


Top 50 recent answers are included