I edited this file like this, but it doesn't work
...do_action( 'rss2_head' );
while ( have_posts() ) :
the_post();
$meta = get_post_meta($post->ID, "add_in_rss", false);
if($meta = "yes"){
?>
<item>
<title><?php the_title_rss(); ?><....
....
....p 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; ?>...
What is the mistake, how should it be right?
I am not a programmer. I entered this based on this code only removed the exclamation mark so that there would be a reverse trigger.
Sorry for My English.
I edited this file like this, but it doesn't work
...do_action( 'rss2_head' );
while ( have_posts() ) :
the_post();
$meta = get_post_meta($post->ID, "add_in_rss", false);
if($meta = "yes"){
?>
<item>
<title><?php the_title_rss(); ?><....
....
....p 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; ?>...
What is the mistake, how should it be right?
I am not a programmer. I entered this based on this code only removed the exclamation mark so that there would be a reverse trigger.
Sorry for My English.
Share Improve this question edited Feb 7, 2020 at 14:39 fuxia♦ 107k39 gold badges255 silver badges459 bronze badges asked Feb 7, 2020 at 12:29 UserDominUserDomin 11 Answer
Reset to default 1Change if($meta = "yes")
to if($meta == 'yes')
. Your way is setting the variable to yes, so it's always yes; the double equals symbol means to test for a condition rather than set it.
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744769002a4592641.html
评论列表(0条)