I edited this file like this, but it doesn't work

    ...do_action( 'rss2_head' );

    while ( have_posts() ) :
        $meta = get_post_meta($post->ID, "add_in_rss", false);
        if($meta = "yes"){
        <title><?php the_title_rss(); ?><....
....p echo get_comments_number(); ?></slash:comments>
        <?php endif; ?>

        <?php rss_enclosure(); ?>

         * Fires at the end of each RSS2 feed item.
         * @since 2.0.0
        do_action( 'rss2_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.


Change 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.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.