WordPress.org

Ready to get started?Download WordPress

Forums

Nested if elseif to ger content slider and featured image help need (1 post)

  1. thewayur
    Member
    Posted 2 years ago #

    Hi, i am noob in wordpress, but bit understand some WP's functions.

    I am modifying a slider, defaultly it shows featured image or video, if both not exist, it shows blank, which upsets me and force me to upload a featured image.

    so i want another function to show some selected part of my post content instead blank without removing formatting unlike excerpt. please advice me.

    my mind says, if i give attribute in div , and that div shows in slider, it will be fantastic, my slider shows up to 640x350

    and here my code

    <?php $main_video=get_post_meta($post->ID, 'embed', true); ?>
    <?php if ( $main_video ) : ?>
    <div><?php echo get_post_meta($post->ID, "embed", $single = true); ?></div>
    <?php else : ?>
    <?php the_post_thumbnail( 'content_image' ); ?>
    <?php endif; ?>

Topic Closed

This topic has been closed to new replies.

About this Topic