رفتن به مطلب

hamidrta

عضو سایت
  • تعداد ارسال‌ها

    279
  • تاریخ عضویت

  • آخرین بازدید

نوشته‌ها ارسال شده توسط hamidrta

  1. با سلام دوستان ما
    برای rss کد نویسی انجام شده بصورت جدول اما وقتی اطلاعات rss رو از طریق گوشی یا تبلیت نگاه می کنیم اطلاعات جدول بصورت کامل نمایش داده نمیشه و فونت ها به هم می ریزه .

    اسکرین شات تهیه کردم گذاشتم:
    داخل عکسها نوشته ها زیر را نگاه کنید:

    توضیحات و نوع سفر

    رو ببینید چطوری نوشته شده؟و نوع فونت خراب نشون می ده اینو از داخل گوشی تهیه کردم.

    اینم کدهای rss ما کسی می تونه کمک کنه و بگه باید چی اضافه بکنیم   یا برامون کد اضافه کنه به این کدها که این مشکل حل شه متشکرم

    <?php
    /**
     * RSS2 Feed Template for displaying RSS2 Posts feed.
     *
     * @package WordPress
     */
    
    header('Content-Type: ' . feed_content_type('rss2') . '; charset=' . get_option('blog_charset'), true);
    $more = 1;
    
    echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>';
    
    /**
     * Fires between the xml and rss tags in a feed.
     *
     * @since 4.0.0
     *
     * @param string $context Type of feed. Possible values include 'rss2', 'rss2-comments',
     *                        'rdf', 'atom', and 'atom-comments'.
     */
    do_action( 'rss_tag_pre', 'rss2' );
    ?>
    <rss version="2.0"
    	xmlns:content="http://purl.org/rss/1.0/modules/content/"
    	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
    	xmlns:dc="http://purl.org/dc/elements/1.1/"
    	xmlns:atom="http://www.w3.org/2005/Atom"
    	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
    	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
    	<?php
    	/**
    	 * Fires at the end of the RSS root to add namespaces.
    	 *
    	 * @since 2.0.0
    	 */
    	do_action( 'rss2_ns' );
    	?>
    >
    
    <channel>
    	<title><?php wp_title_rss(); ?></title>
    	<atom:link href="<?php self_link(); ?>" rel="self" type="application/rss+xml" />
    	<link><?php bloginfo_rss('url') ?></link>
    	<description><?php bloginfo_rss("description") ?></description>
    	<lastBuildDate><?php echo mysql2date('D, d M Y H:i:s +0000', get_lastpostmodified('GMT'), false); ?></lastBuildDate>
    	<language>ar</language>
    	<sy:updatePeriod><?php
    		$duration = 'hourly';
    
    		/**
    		 * Filter how often to update the RSS feed.
    		 *
    		 * @since 2.1.0
    		 *
    		 * @param string $duration The update period. Accepts 'hourly', 'daily', 'weekly', 'monthly',
    		 *                         'yearly'. Default 'hourly'.
    		 */
    		echo apply_filters( 'rss_update_period', $duration );
    	?></sy:updatePeriod>
    	<sy:updateFrequency><?php
    		$frequency = '1';
    
    		/**
    		 * Filter the RSS update frequency.
    		 *
    		 * @since 2.1.0
    		 *
    		 * @param string $frequency An integer passed as a string representing the frequency
    		 *                          of RSS updates within the update period. Default '1'.
    		 */
    		echo apply_filters( 'rss_update_frequency', $frequency );
    	?></sy:updateFrequency>
    	<?php
    	/**
    	 * Fires at the end of the RSS2 Feed Header.
    	 *
    	 * @since 2.0.0
    	 */
    	do_action( 'rss2_head');
    
    	while( have_posts()) : the_post();
    	global $post;
    	$is_feature = get_post_meta(get_the_ID(), 'zttour_is_feature', true);
                    $is_active = get_post_meta(get_the_ID(), 'zttour_is_active', true);
                    $is_last_tiem = get_post_meta(get_the_ID(), 'zttour_is_last_time', true);
                    $is_nowruz = get_post_meta(get_the_ID(), 'zttour_is_nowruz', true);
    	$metaValue1 = get_post_meta($post->ID, 'zttour_price_from', true);
    $source = get_post_meta($post->ID, 'zttour_source', true);
    	?>
    	<item>
    		<title><?php the_title_rss() ?></title>
    		<link><?php the_permalink_rss() ?></link>
    <?php if ( get_comments_number() || comments_open() ) : ?>
    		<comments><?php comments_link_feed(); ?></comments>
    <?php endif; ?>
    		<pubDate><?php echo mysql2date('D, d M Y H:i:s +0000', get_post_time('Y-m-d H:i:s', true), false); ?></pubDate>
    		<dc:creator><![CDATA[<?php the_author() ?>]]></dc:creator>
    		<?php the_category_rss('rss2') ?>
    
    		<guid isPermaLink="false"><?php the_guid(); ?></guid>
    <?php if (get_option('rss_use_excerpt')) : ?>
    		<description><![CDATA[esle1]]></description>
    <?php else : ?>
    		<description><![CDATA[	<?php  
    						if( ! get_post_meta(get_the_ID(), 'zttour_source', TRUE)){
    						
    						
    the_content();}
    						else {  ?>
    <div class="single_tour <?php echo ($is_feature == 1) ? 'zttour_featured' : ''; ?> <?php echo ($is_last_tiem == 1) ? 'zttour_last_time' : ''; ?> <?php echo ($is_nowruz == 1) ? 'zttour_nowruz' : ''; ?>">
                        <div class="tour_content">
                            <?php
                            if ($is_active == 0) {
                                echo '<div class="zttour_expired">' . __('این تور منقضی شده است', 'ztframe_tour') . '</div>';
                            } 
                            ?>
    					
                            <div class="tabletitle"><h4>اطلاعات تور</h4></div>
                            <table class="table" border="1"  border="1" cellpadding="5px" cellspacing="0px"  width="100%" >
                                <tbody>
                                    <tr>
                                        <td class="rightcolumn tour_vert_title">از</td>
                                        <td class="tour_vert_value" align="right"><?php echo get_post_meta(get_the_ID(), 'zttour_source', TRUE); ?><br></td>
                                    </tr>
                                    <tr>
                                        <td class="rightcolumn tour_vert_title">نوع سفر</td>
                                        <?php
                                        $trans = get_post_meta(get_the_ID(), 'zttour_transport', TRUE);
                                        $trans_name = array('1' => 'هوایی', '2' => 'دریایی', '3' => 'زمینی با قطار', '4' => 'زمینی با اتوبوس');
                                        $transer = get_post_meta(get_the_ID(), 'zttour_transporter', TRUE);
                                        ?>
                                        <td class="tour_vert_value" align="right"><?php echo $trans_name[$trans] . ' - ' . $transer; ?></td>
                                    </tr>
                                    <tr>
                                        <td class="rightcolumn tour_vert_title">قیمت از</td>
                                        <?php
                                        $price_from = get_post_meta(get_the_ID(), 'zttour_price_from', TRUE);
                                        $price_dolar = get_post_meta(get_the_ID(), 'zttour_price_by_dolar', TRUE);
                                        ?>
                                        <td class="tour_vert_value" align="right">
                                            <?php
                                            $price_from_ech = (is_numeric($price_from)) ? number_format($price_from) : $price_from;
                                            echo '<span class="number">' . $price_from_ech . '</span> تومان';
                                            if (!empty($price_dolar)) {
                                                echo ' + <span class="number">' . $price_dolar . '</span>';
                                            }
                                            ?>
                                        </td>
                                    </tr>
                                    <?php
                                    $from_date = get_post_meta(get_the_ID(), 'zttour_start_date', TRUE);
                                    $to_date = get_post_meta(get_the_ID(), 'zttour_end_date', TRUE);
                                    if (!empty($from_date) OR ! empty($to_date)) {
                                        ?>
                                        <tr>
                                            <td class="rightcolumn tour_vert_title">تاریخ</td>
                                            <td class="tour_vert_value" align="right">
                                                <span class="tour_start_date">
                                                    <?php
                                                    if (!empty($from_date)) {
                                                        $from_date = jdate('j F Y', zt_strtotime($from_date));
                                                        echo 'تاریخ شروع تور : <span class="date">' . $from_date . '</span>';
                                                    }
                                                    ?>
                                                </span>
                                                <span class="tour_end_date">
                                                    <?php
                                                    if (!empty($to_date)) {
                                                        $to_date = jdate('j F Y', zt_strtotime($to_date));
                                                        echo ' ، تاریخ پایان تور : <span class="date">' . $to_date . '</span>';
                                                    }
                                                    ?>
                                                </span>
                                            </td>
                                        </tr>
                                    <?php } ?>
    
                                    <tr>
                                        <td class="rightcolumn tour_vert_title">مدارک لازم</td>
                                        <td class="tour_vert_value" align="right"><?php echo nl2br(get_post_meta(get_the_ID(), 'zttour_docs', TRUE)); ?><br>
                                        </td>
                                    </tr>
    
                                    <tr>
                                        <td class="rightcolumn tour_vert_title">خدمات آژانس</td>
                                        <td class="tour_vert_value" align="right"><?php echo nl2br(get_post_meta(get_the_ID(), 'zttour_service', TRUE)); ?></td>
                                    </tr>
    
                                    <tr>
                                        <td class="rightcolumn tour_vert_title">توضيحات</td>
                                        <td class="tour_vert_value" align="right"><?php echo nl2br(get_post_meta(get_the_ID(), 'zttour_description', TRUE)); ?></td>
                                    </tr>
                             
    
                                </tbody>
                            </table>
                            <?php
                            the_content();
                            ?>
                            <?php if ($is_active == 1) { ?>
                                <div class="tabletitle"><h4>اطلاعات تماس</h4></div>
                                <table class="table "  border="1" cellpadding="5px" cellspacing="0px"  width="100%">
                                    <tbody>
                                        <tr>
                                            <td class="rightcolumn tour_vert_title">نام آژانس</td>
                                            <td class="tour_vert_value" align="right">
                                                <?php /*                                             * * /?>
                                                  <a href="<?php echo get_author_posts_url(get_the_author_ID()); ?>"><?php echo get_the_author(); ?></a>
                                                  <?php /* * */ ?>
                                                <a href="<?php echo get_author_posts_url(get_the_author_ID()); ?>"><?php echo get_user_meta(get_the_author_ID(), 'agency_name', true); ?></a>
    
                                            </td>
                                        </tr>
    
                                        <tr>
                                            <td class="rightcolumn tour_vert_title">تلفن</td>
                                            <td class="tour_vert_value" align="right"><?php the_author_meta('tel'); ?></td>
                                        </tr>
    
                                        <?php /**/ ?>
                                        <tr>
                                            <td class="rightcolumn tour_vert_title">ایمیل</td>
                                            <td class="tour_vert_value" align="right"><a href="mailto:<?php the_author_email(); ?>" target="_blank"><?php the_author_email(); ?></a></td>
                                        </tr>
                                        <?php /**/ ?>
                                        
                                    </tbody>
                                </table>
                            <?php } ?>
    
                            <div class="tabletitle"><h4>به</h4></div>
                            <table class="table tour_table tour_destination"  border="1" cellpadding="5px" cellspacing="0px" width="100%">
                                <tbody>
                                    <tr class="tablerow">
                                        <td class="horis_title">نام</td>
                                        <td class="horis_title">مدت اقامت</td>
                                        <td class="horis_title">توضيحات</td>
                                    </tr>
                                    <?php
                                    $destination = get_post_meta(get_the_ID(), 'zttour_destination', TRUE);
                                    $stay = get_post_meta(get_the_ID(), 'zttour_stay', TRUE);
                                    $dest_description = get_post_meta(get_the_ID(), 'zttour_dest_description', TRUE);
                                    if (is_array($destination))
                                        foreach ($destination as $dk => $dst) {
                                            ?>
                                            <tr>
                                                <td><?php echo $dst; ?></td>
                                                <td><?php echo $stay[$dk]; ?> شب</td>
                                                <td><?php echo $dest_description[$dk]; ?></td>
                                            </tr>
                                            <?php
                                        }
                                    ?>
    
                                </tbody>
                            </table>
     <?php
                                    $h_name = get_post_meta(get_the_ID(), 'zttour_hotel_name', TRUE);
                                    $h_rate = get_post_meta(get_the_ID(), 'zttour_hotel_rate', TRUE);
                                    $h_service = get_post_meta(get_the_ID(), 'zttour_hotel_service', TRUE);
                                    $h_link = get_post_meta(get_the_ID(), 'zttour_hotel_link', TRUE);
    
                                    $h_description = get_post_meta(get_the_ID(), 'zttour_hotel_description', TRUE);
    
                                    $hotel_title_1 = get_post_meta(get_the_ID(), 'zttour_hotel_title_1', TRUE);
                                    $hotel_price_1 = get_post_meta(get_the_ID(), 'zttour_hotel_price_1', TRUE);
    
                                    $hotel_title_2 = get_post_meta(get_the_ID(), 'zttour_hotel_title_2', TRUE);
                                    $hotel_price_2 = get_post_meta(get_the_ID(), 'zttour_hotel_price_2', TRUE);
    
                                    $hotel_title_3 = get_post_meta(get_the_ID(), 'zttour_hotel_title_3', TRUE);
                                    $hotel_price_3 = get_post_meta(get_the_ID(), 'zttour_hotel_price_3', TRUE);
    
                                    $hotel_title_4 = get_post_meta(get_the_ID(), 'zttour_hotel_title_4', TRUE);
                                    $hotel_price_4 = get_post_meta(get_the_ID(), 'zttour_hotel_price_4', TRUE);
    
                                    $hotel_title_5 = get_post_meta(get_the_ID(), 'zttour_hotel_title_5', TRUE);
                                    $hotel_price_5 = get_post_meta(get_the_ID(), 'zttour_hotel_price_5', TRUE);
    
                                    $title_array = array_filter(array($hotel_title_1[0], $hotel_title_2[0], $hotel_title_3[0], $hotel_title_4[0], $hotel_title_5[0]));
                                    $price_array = array($hotel_price_1, $hotel_price_2, $hotel_price_3, $hotel_price_4, $hotel_price_5);
                                    ?>
    								<?php
    if ($hotel_title_1[0]) { ?> 
    
                            <div class="tabletitle"><h4>هتل‌ها</h4></div>
                            <table class="table tour_table tour_hotel"   border="1" cellpadding="5px" cellspacing="0px" width="100%">
                                <tbody>
                                   
                                    <tr class="tablerow">
                                        <td class="horis_title hotel_name">نام هتل</td>
                                        
                                        <?php
                                        if (is_array($title_array))
                                            foreach ($title_array as $title) {
    
                                                echo '<td class="horis_title">' . $title . '</td>';
                                            }
                                        ?>
                                         
                                    </tr>
                                    <?php
                                    if (is_array($h_name))
                                        foreach ($h_name as $hk => $hotel_name) {
                                            ?>
                                            <tr>
                                                <td class="hotel_names">
                                                    <?php foreach ($hotel_name as $k => $v) { ?>
                                                        <p class="a_hotel">
                                                            <?php
                                                            $temp_link = $h_link[$hk][$k];
                                                            if (empty($temp_link)) {
                                                                $temp_link = '#';
                                                            } elseif (strpos($temp_link, 'http://') === FALSE AND strpos($temp_link, 'https://') === FALSE) {
                                                                $temp_link = 'http://' . $temp_link;
                                                            }
                                                            ?>
                                                            <a href="<?php echo $temp_link; ?>" target="_blank"><?php echo $v; ?></a>
                                                            <br/>
                                                            <span class="hotel_stars">
                                                                <?php
                                                                if (!is_numeric($h_rate[$hk][$k])) {
                                                                    echo '<span class="h_n_type">' . $h_rate[$hk][$k] . '</span>';
                                                                } else {
                                                                    ?>
                                                                    <?php for ($s = 1; $s <= $h_rate[$hk][$k]; $s++) { ?>
                                                                        <i class="fa fa-star"></i>
                                                                        <?php
                                                                    }
                                                                }
                                                                ?>
                                                            </span>
                                                        </p>
                                                    <?php } ?>
                                                </td>
                                        
    
                                                <?php
                                                foreach ($title_array as $tk => $title) {
                                                    $price = (is_numeric($price_array[$tk][$hk])) ? number_format($price_array[$tk][$hk]) : $price_array[$tk][$hk];
                                                    echo '<td class="hotel_price">';
                                                    echo '<span class="number">' . $price . ' تومان </span>';
                                                    echo '</td>';
                                                }
                                                ?>
    
                                                
    
                                            </tr>
                                        <?php } ?>
    
                                </tbody>
                            </table> <?php } ?> 
                        </div>
    
                    </div>
    	
    	<?php  } ?>
    	]]></description>
    	<?php $content = get_the_content_feed('rss2'); ?>
    	<?php if ( strlen( $content ) > 0 ) : ?>
    		<content:encoded><![CDATA[<?php echo $content; ?>]]></content:encoded>
    	<?php else : ?>
    		<content:encoded><![CDATA[<?php the_excerpt_rss(); ?>]]></content:encoded>
    	<?php endif; ?>
    <?php endif; ?>
    <?php if ( get_comments_number() || comments_open() ) : ?>
    		<wfw:commentRss><?php echo esc_url( get_post_comments_feed_link(null, 'rss2') ); ?></wfw:commentRss>
    		<slash:comments><?php echo get_comments_number(); ?></slash:comments>
    <?php endif; ?>
    <?php rss_enclosure(); ?>
    	<?php
    	/**
    	 * Fires at the end of each RSS2 feed item.
    	 *
    	 * @since 2.0.0
    	 */
    	do_action( 'rss2_item' );
    	?>
    	</item>
    	<?php endwhile; ?>
    </channel>
    </rss>
    

     

    Screenshot_2016-02-14-22-40-23.png

    Screenshot_2016-02-14-18-34-36.png

  2. در 9 ساعت قبل، Morteza گفته است :

    روشهای کدنویسی داره اما قبلش این افزونه رو تست کنید:

    https://wordpress.org/plugins/custom-fields-rss/

    یکی از دوستان اینو معرفی کرده بودند!اصلا از این نتونتسم جواب بگیرم نصبش می کنی هیچ ایتمی تویه مدیریت نوشته ها نمیاد اصلا جواب نداد

  3. سلام دوستان من زیاد برنامه نویسی بلد نیستم می خوام یک سری از زمینه های دلخواه وبسایت رو تویه فید نمایش بدم مثلان می خوام این زمینه رو:

    <td class="rightcolumn tour_vert_title">از</td>
                                        <td class="tour_vert_value" align="right"><?php echo get_post_meta(get_the_ID(), 'zttour_source', TRUE); ?><br></td>
                                    </tr>
                                    <tr>

    ازش استفاده کنم و بزار داخل فید سایتم تویه کدهای زیر:

    function fields_in_feed($content) {  
        if(is_feed()) {  
            $post_id = get_the_ID();  
            $output = '<div><h3>Find me on</h3>';  
            $output .= '<p><strong>Facebook:</strong> ' . get_post_meta($post_id, "facebook_url", true) . '</p>';  
            $output .= '<p><strong>Google:</strong> ' . get_post_meta($post_id, "google_url", true) . '</p>';  
            $output .= '<p><strong>Twitter:</strong> ' . get_post_meta($post_id, "twitter_url", true) . '</p>';  
            $output .= '</div>';  
            $content = $content.$output;  
        }  
        return $content;  
    }  
    add_filter('the_content','fields_in_feed');

    اما هر جور کدها رو می زارم جواب نمی گیرم یک نمونه که خودم گذاشتم و فراخوانی نشده!

    function fields_in_feed($content) {  
        if(is_feed()) {  
            $post_id = get_the_ID();  
            $output = '<div><h3>اطلاعات تور</h3>';  
            $output .= '<p><strong>مقصد از:</strong> ' . get_post_meta(get_the_ID(),'zttour_source',true) . '</p>';
            $output .= '<p><strong>نوع سفر:</strong> ' . get_post_meta($zttour_transport,true) . '</p>';  
            $output .= '<p><strong>قیمت از:</strong> ' . get_post_meta($zttour_price_from,true) . '</p>';
            $output .= '</div>';  
            $content = $content.$output;  
        }  
        return $content;  
    }  
    add_filter('the_content','fields_in_feed');

    چیکار کنم و دقیقا باید چه کدی اینجا قرار بدم تا زمینه دلخواه را فراخوانی کنه.

     

    ممنون میشم باتشکر

  4. در 14 ساعت قبل، مهندس فا گفته است :

    من در php تخصصی ندارم . دوستان php کار باید نظر بدن ولی فکر میکنم باید در کد بالا از زمینه های دلخواه به شکل زیر استفاده کنید :

    
            $output .= '<p><strong>zttour_is_feature</strong> ' . get_post_meta(get_the_ID(), 'zttour_is_feature', true) . '</p>';  

    سایر زمینه های دلخواه که به شکل بالا هستن رو باید از فایل single استخراج کنید و به همین ترتیب قرار بدید

    خیلی متشکرم و وقت گذاشتید تا حالا چند تا کد را امتحان کردم ولی هیچ کدوم فراخوانی نشده است. بازم دارم امتحان می کنم دوستان کسی می تونه تو این زمینه کمک کنه ممنون میشم

  5. در 22 ساعت قبل، مهندس فا گفته است :

     

    روش اول منظورتون کد فانکشنه ؟ چطوری جواب داد ؟ چیو تست کردید ؟

    زمینه دلخواه قالبتون رو کد نویسی کردید یا افزونست ؟ اگر کد نویسی کرده باشید باید داخل فایل single  زمینه دلخواه مد نظرتون رو  پیدا کنید و در کد بالا قرار بدید .

    function fields_in_feed($content) {  
        if(is_feed()) {  
            $post_id = get_the_ID();  
            $output = '<div><h3>Find me on</h3>';  
            $output .= '<p><strong>Facebook:</strong> ' . get_post_meta($post_id, "facebook_url", true) . '</p>';  
            $output .= '<p><strong>Google:</strong> ' . get_post_meta($post_id, "google_url", true) . '</p>';  
            $output .= '<p><strong>Twitter:</strong> ' . get_post_meta($post_id, "twitter_url", true) . '</p>';  
            $output .= '</div>';  
            $content = $content.$output;  
        }  
        return $content;  
    }  
    add_filter('the_content','fields_in_feed');
    function fields_in_feed($content) {  
        if(is_feed()) {  
            $post_id = get_the_ID();  
            $output = '<div><h3>Find me on</h3>';  
            $output .= '<p><strong>Facebook:</strong> ' . get_post_meta($post_id, "facebook_url", true) . '</p>';  
            $output .= '<p><strong>Google:</strong> ' . get_post_meta($post_id, "google_url", true) . '</p>';  
            $output .= '<p><strong>Twitter:</strong> ' . get_post_meta($post_id, "twitter_url", true) . '</p>';  
            $output .= '</div>';  
            $content = $content.$output;  
        }  
        return $content;  
    }  
    add_filter('the_content','fields_in_feed');

    اینو گذاشتم نمایش داد!توریه فید مطالب اما چیزی خواست دیگه نگذاشتم

    تا جایی من می دونم برنامه نویسی کردند!اما یک مشکلی که دارم اینه کد نویسی ها رو نتونستم پیدا کنم!که فراخوانی کنم!هر جور می ذارم فراخوانی نمی تونه بکنه و تویه فیدم نشون نمی ده

    این فایل single

    <?php wp_reset_query(); ?>
    <div class="zt_boxArea_12 ">
        <div class="single_ADS_B1">
            <?php zt_get_element('ADS_B1'); ?>
        </div>
        <div class="clear"></div>
        <div class="zt_content">
            <div class="zt_widgetHead">
                <div class="zt_widgetHeadTitle">
                    <h2>
                        <?php wp_reset_query(); ?>
                        <?php the_title(); ?>
                    </h2>
                </div>
                <div class="zt_widgetHeadArchive">
                    <!--<a href="">
                    لیست کامل
                    <i class=""></i></a>-->
                </div>
                <div class="clear"></div>
            </div>
            <div class="zt_widgetBody zt_tour">
    
                <?php
                wp_reset_query();
                while (have_posts()) {
                    the_post();
                    zt_tour_check_expire(get_the_ID());
                    $views = get_post_meta(get_the_ID(), 'views', TRUE);
                    $views = intval($views) + 1;
                    add_post_meta(get_the_ID(), 'views', $views, TRUE)
                            OR update_post_meta(get_the_ID(), 'views', $views);
                    $is_feature = get_post_meta(get_the_ID(), 'zttour_is_feature', true);
                    $is_active = get_post_meta(get_the_ID(), 'zttour_is_active', true);
                    $is_last_tiem = get_post_meta(get_the_ID(), 'zttour_is_last_time', true);
                    $is_nowruz = get_post_meta(get_the_ID(), 'zttour_is_nowruz', true);
                    ?>
                    <div class="single_tour <?php echo ($is_feature == 1) ? 'zttour_featured' : ''; ?> <?php echo ($is_last_tiem == 1) ? 'zttour_last_time' : ''; ?> <?php echo ($is_nowruz == 1) ? 'zttour_nowruz' : ''; ?>">
                        <div class="tour_content">
                            <?php
                            if ($is_active == 0) {
                                echo '<div class="zttour_expired">' . __('این تور منقضی شده است', 'ztframe_tour') . '</div>';
                            }
                            ?>
                            <div class="tabletitle"><h4>اطلاعات تور</h4></div>
                            <table class="table" cellpadding="0" cellspacing="0" width="100%">
                                <tbody>
                                    <tr>
                                        <td class="rightcolumn tour_vert_title">از</td>
                                        <td class="tour_vert_value" align="right"><?php echo get_post_meta(get_the_ID(), 'zttour_source', TRUE); ?><br></td>
                                    </tr>
                                    <tr>
                                        <td class="rightcolumn tour_vert_title">نوع سفر</td>
                                        <?php
                                        $trans = get_post_meta(get_the_ID(), 'zttour_transport', TRUE);
                                        $trans_name = array('1' => 'هوایی', '2' => 'دریایی', '3' => 'زمینی با قطار', '4' => 'زمینی با اتوبوس');
                                        $transer = get_post_meta(get_the_ID(), 'zttour_transporter', TRUE);
                                        ?>
                                        <td class="tour_vert_value" align="right"><?php echo $trans_name[$trans] . ' - ' . $transer; ?></td>
                                    </tr>
                                    <tr>
                                        <td class="rightcolumn tour_vert_title">قیمت از</td>
                                        <?php
                                        $price_from = get_post_meta(get_the_ID(), 'zttour_price_from', TRUE);
                                        $price_dolar = get_post_meta(get_the_ID(), 'zttour_price_by_dolar', TRUE);
                                        ?>
                                        <td class="tour_vert_value" align="right">
                                            <?php
                                            $price_from_ech = (is_numeric($price_from)) ? number_format($price_from) : $price_from;
                                            echo '<span class="number">' . $price_from_ech . '</span> تومان';
                                            if (!empty($price_dolar)) {
                                                echo ' + <span class="number">' . $price_dolar . '</span>';
                                            }
                                            ?>
                                        </td>
                                    </tr>
                                    <?php
                                    $from_date = get_post_meta(get_the_ID(), 'zttour_start_date', TRUE);
                                    $to_date = get_post_meta(get_the_ID(), 'zttour_end_date', TRUE);
                                    if (!empty($from_date) OR ! empty($to_date)) {
                                        ?>
                                        <tr>
                                            <td class="rightcolumn tour_vert_title">تاریخ</td>
                                            <td class="tour_vert_value" align="right">
                                                <span class="tour_start_date">
                                                    <?php
                                                    if (!empty($from_date)) {
                                                        $from_date = jdate('j F Y', zt_strtotime($from_date));
                                                        echo 'تاریخ شروع تور : <span class="date">' . $from_date . '</span>';
                                                    }
                                                    ?>
                                                </span>
                                                <span class="tour_end_date">
                                                    <?php
                                                    if (!empty($to_date)) {
                                                        $to_date = jdate('j F Y', zt_strtotime($to_date));
                                                        echo ' ، تاریخ پایان تور : <span class="date">' . $to_date . '</span>';
                                                    }
                                                    ?>
                                                </span>
                                            </td>
                                        </tr>
                                    <?php } ?>
    
                                    <tr>
                                        <td class="rightcolumn tour_vert_title">مدارک لازم</td>
                                        <td class="tour_vert_value" align="right"><?php echo nl2br(get_post_meta(get_the_ID(), 'zttour_docs', TRUE)); ?><br>
                                        </td>
                                    </tr>
    
                                    <tr>
                                        <td class="rightcolumn tour_vert_title">خدمات آژانس</td>
                                        <td class="tour_vert_value" align="right"><?php echo nl2br(get_post_meta(get_the_ID(), 'zttour_service', TRUE)); ?></td>
                                    </tr>
    
                                    <tr>
                                        <td class="rightcolumn tour_vert_title">توضيحات</td>
                                        <td class="tour_vert_value" align="right"><?php echo nl2br(get_post_meta(get_the_ID(), 'zttour_description', TRUE)); ?></td>
                                    </tr>
                                    <?php if (function_exists('wprp')) { ?>
                                        <tr>
                                            <td class="rightcolumn tour_vert_title">گزارش تخلف</td>
                                            <td class="tour_vert_value" align="right"><?php wprp(true); ?></td>
                                        </tr>
                                    <?php } ?>
    
                                </tbody>
                            </table>
                            <?php
                            the_content();
                            ?>
                            <?php if ($is_active == 1) { ?>
                                <div class="tabletitle"><h4>اطلاعات تماس</h4></div>
                                <table class="table " cellpadding="0" cellspacing="0" width="100%">
                                    <tbody>
                                        <tr>
                                            <td class="rightcolumn tour_vert_title">نام آژانس</td>
                                            <td class="tour_vert_value" align="right">
                                                <?php /*                                             * * /?>
                                                  <a href="<?php echo get_author_posts_url(get_the_author_ID()); ?>"><?php echo get_the_author(); ?></a>
                                                  <?php /* * */ ?>
                                                <a href="<?php echo get_author_posts_url(get_the_author_ID()); ?>"><?php echo get_user_meta(get_the_author_ID(), 'agency_name', true); ?></a>
    
                                            </td>
                                        </tr>
    
                                        <tr>
                                            <td class="rightcolumn tour_vert_title">تلفن</td>
                                            <td class="tour_vert_value" align="right"><?php the_author_meta('tel'); ?></td>
                                        </tr>
    
                                        <?php /**/ ?>
                                        <tr>
                                            <td class="rightcolumn tour_vert_title">ایمیل</td>
                                            <td class="tour_vert_value" align="right"><a href="mailto:<?php the_author_email(); ?>" target="_blank"><?php the_author_email(); ?></a></td>
                                        </tr>
                                        <?php /**/ ?>
                                        <tr>
                                            <td class="rightcolumn tour_vert_title">وب سایت</td>
                                            <td class="tour_vert_value" align="right"><a href="<?php the_author_meta('url'); ?>" target="_blank"><?php the_author_meta('url'); ?></a></td>
                                        </tr>
                                    </tbody>
                                </table>
                            <?php } ?>
    
                            <div class="tabletitle"><h4>به</h4></div>
                            <table class="table tour_table tour_destination" cellpadding="0" cellspacing="0" width="100%">
                                <tbody>
                                    <tr class="tablerow">
                                        <td class="horis_title">نام</td>
                                        <td class="horis_title">مدت اقامت</td>
                                        <td class="horis_title">توضيحات</td>
                                    </tr>
                                    <?php
                                    $destination = get_post_meta(get_the_ID(), 'zttour_destination', TRUE);
                                    $stay = get_post_meta(get_the_ID(), 'zttour_stay', TRUE);
                                    $dest_description = get_post_meta(get_the_ID(), 'zttour_dest_description', TRUE);
                                    if (is_array($destination))
                                        foreach ($destination as $dk => $dst) {
                                            ?>
                                            <tr>
                                                <td><?php echo $dst; ?></td>
                                                <td><?php echo $stay[$dk]; ?> شب</td>
                                                <td><?php echo $dest_description[$dk]; ?></td>
                                            </tr>
                                            <?php
                                        }
                                    ?>
    
                                </tbody>
                            </table>
    
    
                            <div class="tabletitle"><h4>هتل‌ها</h4></div>
                            <table class="table tour_table tour_hotel" cellpadding="0" cellspacing="0" width="100%">
                                <tbody>
                                    <?php
                                    $h_name = get_post_meta(get_the_ID(), 'zttour_hotel_name', TRUE);
                                    $h_rate = get_post_meta(get_the_ID(), 'zttour_hotel_rate', TRUE);
                                    $h_service = get_post_meta(get_the_ID(), 'zttour_hotel_service', TRUE);
                                    $h_link = get_post_meta(get_the_ID(), 'zttour_hotel_link', TRUE);
    
                                    $h_description = get_post_meta(get_the_ID(), 'zttour_hotel_description', TRUE);
    
                                    $hotel_title_1 = get_post_meta(get_the_ID(), 'zttour_hotel_title_1', TRUE);
                                    $hotel_price_1 = get_post_meta(get_the_ID(), 'zttour_hotel_price_1', TRUE);
    
                                    $hotel_title_2 = get_post_meta(get_the_ID(), 'zttour_hotel_title_2', TRUE);
                                    $hotel_price_2 = get_post_meta(get_the_ID(), 'zttour_hotel_price_2', TRUE);
    
                                    $hotel_title_3 = get_post_meta(get_the_ID(), 'zttour_hotel_title_3', TRUE);
                                    $hotel_price_3 = get_post_meta(get_the_ID(), 'zttour_hotel_price_3', TRUE);
    
                                    $hotel_title_4 = get_post_meta(get_the_ID(), 'zttour_hotel_title_4', TRUE);
                                    $hotel_price_4 = get_post_meta(get_the_ID(), 'zttour_hotel_price_4', TRUE);
    
                                    $hotel_title_5 = get_post_meta(get_the_ID(), 'zttour_hotel_title_5', TRUE);
                                    $hotel_price_5 = get_post_meta(get_the_ID(), 'zttour_hotel_price_5', TRUE);
    
                                    $title_array = array_filter(array($hotel_title_1[0], $hotel_title_2[0], $hotel_title_3[0], $hotel_title_4[0], $hotel_title_5[0]));
                                    $price_array = array($hotel_price_1, $hotel_price_2, $hotel_price_3, $hotel_price_4, $hotel_price_5);
                                    ?>
                                    <tr class="tablerow">
                                        <td class="horis_title hotel_name">نام هتل</td>
                                        <td class="horis_title">خدمات هتل</td>
                                        <?php
                                        if (is_array($title_array))
                                            foreach ($title_array as $title) {
    
                                                echo '<td class="horis_title">' . $title . '</td>';
                                            }
                                        ?>
                                        <td class="horis_title">توضيحات</td>
                                    </tr>
                                    <?php
                                    if (is_array($h_name))
                                        foreach ($h_name as $hk => $hotel_name) {
                                            ?>
                                            <tr>
                                                <td class="hotel_names">
                                                    <?php foreach ($hotel_name as $k => $v) { ?>
                                                        <p class="a_hotel">
                                                            <?php
                                                            $temp_link = $h_link[$hk][$k];
                                                            if (empty($temp_link)) {
                                                                $temp_link = '#';
                                                            } elseif (strpos($temp_link, 'http://') === FALSE AND strpos($temp_link, 'https://') === FALSE) {
                                                                $temp_link = 'http://' . $temp_link;
                                                            }
                                                            ?>
                                                            <a href="<?php echo $temp_link; ?>" target="_blank"><?php echo $v; ?></a>
                                                            <br/>
                                                            <span class="hotel_stars">
                                                                <?php
                                                                if (!is_numeric($h_rate[$hk][$k])) {
                                                                    echo '<span class="h_n_type">' . $h_rate[$hk][$k] . '</span>';
                                                                } else {
                                                                    ?>
                                                                    <?php for ($s = 1; $s <= $h_rate[$hk][$k]; $s++) { ?>
                                                                        <i class="fa fa-star"></i>
                                                                        <?php
                                                                    }
                                                                }
                                                                ?>
                                                            </span>
                                                        </p>
                                                    <?php } ?>
                                                </td>
                                                <td  class="hotel_services">
                                                    <?php foreach ($hotel_name as $k => $v) { ?>
                                                        <p class="a_hotel hotel_service">
                                                            <?php echo $h_service[$hk][$k]; ?>
                                                        </p>
                                                    <?php } ?>
                                                </td>
    
                                                <?php
                                                foreach ($title_array as $tk => $title) {
                                                    $price = (is_numeric($price_array[$tk][$hk])) ? number_format($price_array[$tk][$hk]) : $price_array[$tk][$hk];
                                                    echo '<td class="hotel_price">';
                                                    echo '<span class="number">' . $price . ' تومان </span>';
                                                    echo '</td>';
                                                }
                                                ?>
    
                                                <td class="hotel_desc"><?php echo $h_description[$hk]; ?></td>
    
                                            </tr>
                                        <?php } ?>
    
                                </tbody>
                            </table>
                        </div>
    
                    </div>
                <?php } ?>
                <div class="tour_relateds">
                    <?php zt_get_element('tour_related'); ?>
                    <?php zt_get_element('tour_latest'); ?>
                </div>
                <div class="single_ADS_B2">
                    <?php zt_get_element('ADS_B2'); ?>
                </div>
                <div class="clear"></div>
                <?php
                wp_reset_query();
                while (have_posts()) {
                    the_post();
                    ?>
                    <div class="clear"></div>
                    <div class="tour_tags">
                        <div class="comment_title"><h4>برچسب ها</h4></div>
                        <div class="tour_tag">
                            <?php the_tags('', '', '') ?>
                        </div>
                    </div>
                    <div class="clear"></div>
                    <div class="tour_comments">
                        <div class="comment_title"><h4>نظرات</h4></div>
                        <div class="comment_title">
                            <?php zt_get_comment() ?>
                        </div>
                    </div>
                <?php } ?>
            </div>
            <div class="zt_widgetFoot"></div>
            <div class="clear"></div>
        </div>
    </div>

     

  6. در در 1/20/2016 at 01:53، مهندس فا گفته است :

    یک کد شبیه کد زیر تو فایل فانکشن بزارید . تفاوتش اینه که برای هر زمینه دلخواه یک خروجی در نظر بگیرید . مثل کد زیر که سه تا خروجی فیسبوک گوگل و توئیتر در نظر گرفته .

    
    function fields_in_feed($content) {  
        if(is_feed()) {  
            $post_id = get_the_ID();  
            $output = '<div><h3>Find me on</h3>';  
            $output .= '<p><strong>Facebook:</strong> ' . get_post_meta($post_id, "facebook_url", true) . '</p>';  
            $output .= '<p><strong>Google:</strong> ' . get_post_meta($post_id, "google_url", true) . '</p>';  
            $output .= '<p><strong>Twitter:</strong> ' . get_post_meta($post_id, "twitter_url", true) . '</p>';  
            $output .= '</div>';  
            $content = $content.$output;  
        }  
        return $content;  
    }  
    add_filter('the_content','fields_in_feed');

     

    منبع کد بالا:  http://www.paulund.co.uk/add-custom-fields-to-rss-feed

     

     

    اگر جواب نداد اینجا رو هم ببینید :  https://wordpress.org/support/topic/custom-fields-on-rss-feed-how-to

    ممنون وقت می ذارید و تشکر.

    اما فکر نکنم روش اول جواب بده چون فید های سایت ما رو کاربر پر می کنه!

    اما بازم تست می کنم.

    اگر شما می تونید انجام بدید مشخصات سایت رو بدم برید ببینید می تونی انجام بدید چون ما زیاد وارد نیستیم .

    هزینه رو بهتون می دیم فقط می خواهیم انجام بشه. با تشکر

  7. در در 1/17/2016 at 21:48، مهندس فا گفته است :

    با توجه به اینکه شما از Custom Fields استفاده میکنید امکان در مطالب این بخش در RSS نیست . این افزونه قدیمی در توضیحاتش نوشته با نصب اون میتونید Custom Fields ها رو هم در RSS نمایش بدید . بنده با این افزونه کار نکردم ولی احتمالا در تنظیماتش نوع فیلد ها رو برای نماش در RSS باید مشخص کنید .

    چیزی نتونستم پیدا کنم ایا راه حلی وجود داره شما بلد هستید؟

    هزینه انجام کار را تقدیم می کنم.

  8. سلام دوستان وقت بخیر

    من وقتی نوشته های سایتم را از طریق rss نگاه می کنم. اطلاعات داخلی نوشته دیده نمیشه و فقط عکس دیده میشه در صورتی که عکسم نداشته باشه چیزی دیده نمیشه.

    می خوام تمام آیتم های نوشته هام دیده بشه.

    چون برای نوشته هام فیدهای مختلف تعریف شده فکر می کنم این مشکل را دارد.

    می خواستم کمکم کنید مشکل برطرف بشه

    مثلا در لینک زیر در هنگام مشاهده rss فقط عکس نمایش داده میشه و اطلاعات تاریخ حرکت و قیمت و ....

    دیده نمیشه!

    لینک

×
×
  • اضافه کردن...