Displaying text&shortcodes based on post date
-
I have limited experience customizing WordPress. However, I can’t seem to get this one thing I’d like to work. I’ve tried searching, but apparently my google-fu is weak.
I have a simple site I built for sharing pictures of my daughters. I think my traffic is primarily my mom and some aunts, but I like it also as a digital scrapbook. site is https://b.lueberry.com
I added some code to my content-single.php page to display the age of the girls next to the post date and author. It uses a plug-in called “How old am I” and works well. EXCEPT that for dates before my younger daughter was born, it still shows her name and a date. clearly the plug-in uses an absolute value somewhere.
I’d like modify this page so that it only displays the “Margot was” part on posts after her birthday. seems simple, but I can’t get it to work.
here is the whole header.
<header class="entry-header"> <h1 class="entry-title"><?php the_title(); ?></h1> <div>Posted on <?php the_time('F j, Y'); ?> by <?php the_author_posts_link() ?>, Margot was <?php echo do_shortcode ('[how-old-am-i on="post" bday="2014-4-17"]'); ?>, Hazel was <?php echo do_shortcode ('[how-old-am-i on="post" bday="2011-08-13"]'); ?></div> </header><!-- .entry-header -->
- The topic ‘Displaying text&shortcodes based on post date’ is closed to new replies.