as you are working with a child theme of Twenty Eleven, the post date is displayed using the function ‘twentyeleven_posted_on()’;
to integrate the plugin function into the date output, add this function to functions.php of the child theme:
http://pastebin.com/cBKLp4aF
(unless you have edited the date function already – then paste that code into a pastebin.com and post the link to it here)
main edits explained –
general structure:
(function_exists('get_relative_date')?'this':'that')
which translates into english as:
if the plugin function exists, do ‘this’, otherwise do ‘that’.
the change here adapts the wording conditional on the use of the plugin:
printf( __( '<span class="sep">Posted '.(function_exists('get_relative_date')?'':'on').' </span><a href="%1$s" title="%2$s" rel="bookmark"><time class="entry-date" datetime="%3$s" pubdate>%4$s</time></a>'.(function_exists('get_relative_date')?' ago':'').'<span class="by-au.....
and here conditionally to add the plugin function get_relative_date() in place of get_the_date():
esc_html( (function_exists('get_relative_date')?get_relative_date():get_the_date()) ),
Hi,
Thanks!
I did what you said… But I think I did it wrong somehow.
So I copied all the codes from the Twenty Eleven parent theme’s functions.php and placed it in the child’s functions.php
I then removed these lines from the child’s functions.php and replaced it with your codes.
Where did I go wrong?
So I copied all the codes from the Twenty Eleven parent theme’s functions.php and placed it in the child’s functions.php
– never copy the full functions.php from the parent theme into a child theme.
if your child theme did not have a functions.php, just make an empty new functions.php file, and add
<?php
at the very start in the first line;
then add any new code below that into the functions.php in the child theme.
Now it works, thanks alchymyth!