0

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.

1

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.