رفتن به مطلب

مشکل نمایش جدول بصورت کامل در rss


پست های پیشنهاد شده

با سلام دوستان ما
برای 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

ویرایش شده توسط hamidrta
لینک به ارسال

به گفتگو بپیوندید

هم اکنون می توانید مطلب خود را ارسال نمایید و بعداً ثبت نام کنید. اگر حساب کاربری دارید، برای ارسال با حساب کاربری خود اکنون وارد شوید .

مهمان
ارسال پاسخ به این موضوع ...

×   شما در حال چسباندن محتوایی با قالب بندی هستید.   حذف قالب بندی

  تنها استفاده از 75 اموجی مجاز می باشد.

×   لینک شما به صورت اتوماتیک جای گذاری شد.   نمایش به صورت لینک

×   محتوای قبلی شما بازگردانی شد.   پاک کردن محتوای ویرایشگر

×   شما مستقیما نمی توانید تصویر خود را قرار دهید. یا آن را اینجا بارگذاری کنید یا از یک URL قرار دهید.

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