Last active
May 27, 2016 10:19
-
-
Save sowich/8403ad5acaa6f9c79e00a17ea908d53f to your computer and use it in GitHub Desktop.
Проверка на preview картинку
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$img = false; | |
if (preg_match('#a[^>]+class=\"more-link\"#i', get_the_content())) | |
$img = true; | |
?> | |
<?php if ($img): ?> | |
<img src="<?php echo catch_that_image() ?>" class="news-img" alt="<?php the_title(); ?>"/> | |
<?php endif; ?> | |
... | |
<?php $img ? the_excerpt() : the_content(); ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment