There is a template on WordPress with real estate. I want to display 1 object on a separate page. But in the documentation there is no information and no information is available for Google. Climbed the template and found the page that is responsible for the withdrawal of the property itself. I understand that you can rewrite it so that it displays just 1 record, which is specified in the ID. But how to rewrite it, I'll never know my mind, because the backend just started to learn, more familiar with the front-end. I feel by the fifth point that the decision is somewhere on the surface but the brain is not cooking at all. I would be grateful for any help. Who is not hard to help, please, or at least explain how to find a solution to the issue, so that this record was purely 1 record by ID. I tried, by the way, as a usual post to withdraw - does not respond.

The Insert Page plugin renders pure text without images and other widgets.

<?php // Single property // Wp Estate Pack get_header(); global $feature_list_array; global $propid ; global $post_attachments; global $options; global $where_currency; global $property_description_text; global $property_details_text; global $property_features_text; global $property_adr_text; global $property_price_text; global $property_pictures_text; global $propid; global $gmap_lat; global $gmap_long; global $unit; global $currency; global $use_floor_plans; $current_user = wp_get_current_user(); $propid = $post->ID; $options = wpestate_page_details($post->ID); $gmap_lat = floatval( get_post_meta($post->ID, 'property_latitude', true)); $gmap_long = floatval( get_post_meta($post->ID, 'property_longitude', true)); $unit = esc_html( get_option('wp_estate_measure_sys', '') ); $currency = esc_html( get_option('wp_estate_currency_label_main', '') ); $use_floor_plans = intval( get_post_meta($post->ID, 'use_floor_plans', true) ); if (function_exists('icl_translate') ){ $where_currency = icl_translate('wpestate','wp_estate_where_currency_symbol', esc_html( get_option('wp_estate_where_currency_symbol', '') ) ); $property_description_text = icl_translate('wpestate','wp_estate_property_description_text', esc_html( get_option('wp_estate_property_description_text') ) ); $property_details_text = icl_translate('wpestate','wp_estate_property_details_text', esc_html( get_option('wp_estate_property_details_text') ) ); $property_features_text = icl_translate('wpestate','wp_estate_property_features_text', esc_html( get_option('wp_estate_property_features_text') ) ); $property_adr_text = icl_translate('wpestate','wp_estate_property_adr_text', esc_html( get_option('wp_estate_property_adr_text') ) ); $property_price_text = icl_translate('wpestate','wp_estate_property_price_text', esc_html( get_option('wp_estate_property_price_text') ) ); $property_pictures_text = icl_translate('wpestate','wp_estate_property_pictures_text', esc_html( get_option('wp_estate_property_pictures_text') ) ); }else{ $where_currency = esc_html( get_option('wp_estate_where_currency_symbol', '') ); $property_description_text = esc_html( get_option('wp_estate_property_description_text') ); $property_details_text = esc_html( get_option('wp_estate_property_details_text') ); $property_features_text = esc_html( get_option('wp_estate_property_features_text') ); $property_adr_text = stripslashes ( esc_html( get_option('wp_estate_property_adr_text') ) ); $property_price_text = esc_html( get_option('wp_estate_property_price_text') ); $property_pictures_text = esc_html( get_option('wp_estate_property_pictures_text') ); } $agent_id = ''; $content = ''; $userID = $current_user->ID; $user_option = 'favorites'.$userID; $curent_fav = get_option($user_option); $favorite_class = 'isnotfavorite'; $favorite_text = esc_html__( 'Add to Favorites','wpestate'); $feature_list = esc_html( get_option('wp_estate_feature_list') ); $feature_list_array = explode( ',',$feature_list); $pinteres = array(); $property_city = get_the_term_list($post->ID, 'property_city', '', ', ', '') ; $property_area = get_the_term_list($post->ID, 'property_area', '', ', ', ''); $property_category = get_the_term_list($post->ID, 'property_category', '', ', ', '') ; $property_category_terms = get_the_terms( $post->ID, 'property_category' ); if(is_array($property_category_terms) ){ $temp = array_pop($property_category_terms); $property_category_terms_icon = $temp->slug; $place_id = $temp->term_id; $term_meta = get_option( "taxonomy_$place_id"); if( isset($term_meta['category_icon_image']) && $term_meta['category_icon_image']!='' ){ $property_category_terms_icon=$term_meta['category_icon_image']; }else{ $property_category_terms_icon = get_template_directory_uri().'/img/'.$temp->slug.'-ico.png'; } } $property_action = get_the_term_list($post->ID, 'property_action_category', '', ', ', ''); $property_action_terms = get_the_terms( $post->ID, 'property_action_category' ); if(is_array($property_action_terms) ){ $temp = array_pop($property_action_terms); $place_id = $temp->term_id; $term_meta = get_option( "taxonomy_$place_id"); if( isset($term_meta['category_icon_image']) && $term_meta['category_icon_image']!='' ){ $property_action_terms_icon=$term_meta['category_icon_image']; }else{ $property_action_terms_icon = get_template_directory_uri().'/img/'.$temp->slug.'-ico.png'; } } $slider_size = 'small'; $guests = floatval( get_post_meta($post->ID, 'guest_no', true)); $bedrooms = floatval( get_post_meta($post->ID, 'property_bedrooms', true)); $bathrooms = floatval( get_post_meta($post->ID, 'property_bathrooms', true)); $status = stripslashes( esc_html( get_post_meta($post->ID, 'property_status', true) ) ); if (function_exists('icl_translate') ){ // $status = icl_translate('wpestate','wp_estate_property_status_'.$status, $status ) ; $status = apply_filters( 'wpml_translate_single_string', $property_status, 'wpestate', 'property_status_'.$property_status ); } if($curent_fav){ if ( in_array ($post->ID,$curent_fav) ){ $favorite_class = 'isfavorite'; $favorite_text = esc_html__( 'Favorite','wpestate').'<i class="fa fa-heart"></i>'; } } if (has_post_thumbnail()){ $pinterest = wp_get_attachment_image_src(get_post_thumbnail_id(),'wpestate_property_full_map'); } if($options['content_class']=='col-md-12'){ $slider_size='full'; } $listing_page_type = get_option('wp_estate_listing_page_type',''); if($listing_page_type == 2){ get_template_part('templates/listing_page_2'); }else{ get_template_part('templates/listing_page_1'); } ?> <?php if ( isset($_GET['check_in_prop']) && isset($_GET['check_out_prop']) && isset($_GET['guest_no_prop']) ){ print '<script type="text/javascript"> //<![CDATA[ jQuery(document).ready(function(){ jQuery("#end_date,#start_date").parent().removeClass("calendar_icon"); jQuery("#end_date").trigger("change"); }); //]]> </script>'; } //if( is_user_logged_in() ){} ?> 

    1 answer 1

    From the question it is not quite clear what is where you are, but something like this is necessary to act:

     global $post; $args = array( 'p' => xxx, 'numberposts' => 1, 'post_type' => 'Ρ‚ΠΈΠΏ поста нСдвиТимости' ); $myposts = get_posts( $args ); foreach( $myposts as $post ){ setup_postdata($post); require_once 'имя Ρ„Π°ΠΉΠ»Π° содСрТащСго ΠΊΠΎΠ΄ Π² вопросС'; } wp_reset_postdata(); 

    Of course, instead of xxx you need to insert the ID of the desired post, instead of the Ρ‚ΠΈΠΏ поста нСдвиТимости - the desired type of post, and instead of имя Ρ„Π°ΠΉΠ»Π° содСрТащСго ΠΊΠΎΠ΄ Π² вопросС - the path and file name that contains the code given in your question.

    • It seems yes I am wondering with a question. Roughly speaking, I am trying to make a conclusion wprentals.org/properties/west-town-3rd-floor-dorm of such a page to the main page. I understand that the easiest but karyavy way is the redirect, but as I understand it, there is also a more correct way - Denis Elk
    • it turned out like this <? php global $ post; $ args = array ('p' => 149, 'numberposts' => 1, 'post_type' => 'type of real estate'); $ myposts = get_posts ($ args); foreach ($ myposts as $ post) {setup_postdata ($ post); require_once 'single-estate_property.php'; } wp_reset_postdata (); ?> but what to insert in the type of post? - Denis Elk
    • Open these properties in the admin panel, hover over Properties, see the type of post below. In my example, uni_post_uslugi take.ms/C21jh - KAGG Design
    • Humor plowed, how can you put or add to the reputation? I understand that in fact it is possible to draw a conclusion with many templates or is it only a special case? - Denis Elk
    • thank you so much - Denis Elk