• Resolved marsa1234

    (@marsa1234)


    I’ve looked at the php syntax written by the engineer and it’s fine, but the rss display of the pubdate is incomplete. Some of them disappear and only +0800 remains.
    Does anyone know what the problem is?
    Here is the engineer’s syntax, I have looked at it for a long time and have tried many ways but cannot change it. The company requires the use of pubdate syntax.
    Can anyone help me? Thank you.

    —————————————————–

    <?php
    /*
    Template Name: xml Feed
    */
    header('Content-Type: ' . feed_content_type('rss-http') . '; charset=' . get_option('blog_charset'), true);
    echo '<?xml version="1.0" encoding="utf-8"?>';
    ?>
    <rss version="2.0">
          <channel>
        <title><![CDATA[Wownews RSS 影劇娛樂]]></title>
        <language>zh_tw</language>
        <link>https://www.wownews.tw</link>
        <generator>rss_generator</generator>
        <description><![CDATA[Wownews RSS 影劇娛樂]]></description>
    <?php $experience= new WP_Query( array ( 'post_type' => 'post','posts_per_page' => 10));?>
    <?php while($experience->have_posts()) : $experience->the_post(); 
    
            $featured_image = wp_get_attachment_url( get_post_thumbnail_id($post->ID, 'thumbnail') ); 
            $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'single-post-thumbnail' );
            $thumb_id = get_post_thumbnail_id();
     $thumb_url_array = wp_get_attachment_image_src($thumb_id, 'thumbnail-size', true);
     $thumb_url = $thumb_url_array[0];
     $imageurl = apply_filters( 'jetpack_photon_url', $thumb_url );
    
            ?>
        <item>
          <title><![CDATA[<?php the_title();?>]]></title>
          <description><![CDATA[<?php the_content();?> ]]></description>
          <pubDate><?php the_date( 'd, D F Y H:i:s' ); ?> +0800</pubDate>
          <link><?php the_permalink();?></link>
          <enclosure url="<?php echo $imageurl;?>" />
        </item>
    <?php endwhile;  ?> 
    </channel>
    </rss>
    • This topic was modified 2 years, 11 months ago by marsa1234.

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘pubdate php date not circulation problem’ is closed to new replies.