shortcode – If do_shortcode is blank, return some message
Question
I have a page for employment postings. To expire the posts, I’m using the PostExpirator plugin with the shortcode, [postexpirator]. If not expiration date is selected within the plugin, I’d like to return the message “UNTIL FILLED.”
Here is the code I have working so far.
echo '<div class="entry-content">';
echo '<a href="' . get_permalink() . '" class="block-link">';
echo '<header class="one-half first entry-header block-link-entry-header">';
echo '<p>' . get_the_title() . '</p>';
echo '</header>';
echo '<p class="one-half">';
echo do_shortcode( '[postexpirator]' );
echo '</p>';
echo '</a>';
echo '<hr>';
echo '</div>';
echo '</article>';```
0
1 year
2022-01-20T14:42:46-05:00
2022-01-20T14:42:46-05:00 0 Answers
0 views
0
Leave an answer