Skip to main content
added 2 characters in body
Source Link
turbonerd
  • 1.2k
  • 4
  • 26
  • 50

Something like this might work:

<?php while (have_posts()) : the_post(); ?>
    <?php if ( 'future' === get_post_status( the_ID() ) ) : ?>
    <div <?php post_class(); ?>>
        <div class="news-item" onclick="location.href='<?php echo the_permalink(); ?>'">
            <h2><a href="<?php echo the_permalink(); ?>"><?php echo the_time('d.m.Y'); ?> / <?php echo the_title(); ?></a></h2>
            <p class="news-page">
                <?php if (get_field('description') != "") { ?>
                    <?php echo the_field('description'); ?>
                <?php } else { 
                    $newscontent = get_the_content();
                    $newscontent_str = strip_tags($newscontent, '');
                    echo substr($newscontent_str,0,250) . "…";
                } ?>    
            </p>
        </div>
    </div>
    <?php endif; ?>

Something like this might work:

<?php while (have_posts()) : the_post(); ?>
    <?php if ( 'future' === get_post_status( the_ID() ) : ?>
    <div <?php post_class(); ?>>
        <div class="news-item" onclick="location.href='<?php echo the_permalink(); ?>'">
            <h2><a href="<?php echo the_permalink(); ?>"><?php echo the_time('d.m.Y'); ?> / <?php echo the_title(); ?></a></h2>
            <p class="news-page">
                <?php if (get_field('description') != "") { ?>
                    <?php echo the_field('description'); ?>
                <?php } else { 
                    $newscontent = get_the_content();
                    $newscontent_str = strip_tags($newscontent, '');
                    echo substr($newscontent_str,0,250) . "…";
                } ?>    
            </p>
        </div>
    </div>
    <?php endif; ?>

Something like this might work:

<?php while (have_posts()) : the_post(); ?>
    <?php if ( 'future' === get_post_status( the_ID() ) ) : ?>
    <div <?php post_class(); ?>>
        <div class="news-item" onclick="location.href='<?php echo the_permalink(); ?>'">
            <h2><a href="<?php echo the_permalink(); ?>"><?php echo the_time('d.m.Y'); ?> / <?php echo the_title(); ?></a></h2>
            <p class="news-page">
                <?php if (get_field('description') != "") { ?>
                    <?php echo the_field('description'); ?>
                <?php } else { 
                    $newscontent = get_the_content();
                    $newscontent_str = strip_tags($newscontent, '');
                    echo substr($newscontent_str,0,250) . "…";
                } ?>    
            </p>
        </div>
    </div>
    <?php endif; ?>
Source Link
turbonerd
  • 1.2k
  • 4
  • 26
  • 50

Something like this might work:

<?php while (have_posts()) : the_post(); ?>
    <?php if ( 'future' === get_post_status( the_ID() ) : ?>
    <div <?php post_class(); ?>>
        <div class="news-item" onclick="location.href='<?php echo the_permalink(); ?>'">
            <h2><a href="<?php echo the_permalink(); ?>"><?php echo the_time('d.m.Y'); ?> / <?php echo the_title(); ?></a></h2>
            <p class="news-page">
                <?php if (get_field('description') != "") { ?>
                    <?php echo the_field('description'); ?>
                <?php } else { 
                    $newscontent = get_the_content();
                    $newscontent_str = strip_tags($newscontent, '');
                    echo substr($newscontent_str,0,250) . "…";
                } ?>    
            </p>
        </div>
    </div>
    <?php endif; ?>