• Resolved abzu2

    (@abzu2)


    Had made a modification to Elucidates template_ file so that Posted By is displayed rather than the default By
    It seems that the best way to modify themes is to create a Child Theme in order to maintain modifications when updating the theme.
    Is there a Child Theme template for Elucidate that I can use to make the modifications required to tags.php
    ? Prior to updating from 1.0.2 to 1.1, is it advisable to undo the change I made to tags.php ?

    Not too sure on how to exactly proceed. Not HTML savvy.

    TIA

    AbZu
    abzu2.com

Viewing 11 replies - 16 through 26 (of 26 total)
  • Thread Starter abzu2

    (@abzu2)

    After updating Elucidate to 1.1, template-tags.php is the default:

    function elucidate_byline() {
    printf( __( ‘by’, ‘elucidate’ ) . ‘ ‘ . ‘<span class=”author vcard”>%2$s</span>’,

    My understanding was that the activated child would display the modified template-tags.php that contains:

    function elucidate_byline() {
    printf( __( ‘Posted by’, ‘elucidate’ ) . ‘ ‘ . ‘<span class=”author vcard”>%2$s</span>’,

    Sorry, but I’ve had a close look at your theme’s files here on the repository. I’m afraid it’s not template-tags that you need to duplicate. You need to rewrite the elucidate_byline function in your functions.php file with your modifications.

    To sum up, in your child theme, get rid of template-tags.php, also delete the require statement from functions.php file and below the php opening tag, rewrite the elucidate_byline function with your modifications, like this:

    function elucidate_byline() {
    printf( __( 'Posted by', 'elucidate' ) . ' ' . '<span class="author vcard"><a class="url fn n" href="%1$s">%2$s</a></span>',
    esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
    esc_html( get_the_author() ));
    }

    This way when this function is called from any of the template files in the parent theme it will apply your version of it in your child theme. I know it sounds more complicated than it is, but I think now we’re on the right track.

    Thread Starter abzu2

    (@abzu2)

    antonietta,
    Thank you for your kind reply. I deleted the templates-tags.php from the child and modified the functions.php file to contain ONLY the following:

    <?php
    function elucidate_byline() {
    printf( __( ‘Posted by’, ‘elucidate’ ) . ‘ ‘ . ‘<span class=”author vcard”>%2$s</span>’,
    esc_url( get_author_posts_url( get_the_author_meta( ‘ID’ ) ) ),
    esc_html( get_the_author() ));
    }
    ?>

    Tried eliminating the ?> at the end and obtained the same result: By not Posted by

    Hope you realise that I am HTML illiterate but good at following instructions ??

    Theme Author Chrisdc1

    (@chrisdc1)

    Ok I feel like this is getting rather complicated for adding one extra word, and it didn’t help I gave you the wrong function earlier (get_template_directory instead of get_styleshhet_directory), sorry about that. I hope nobody feels I’m trying to ignore or replace their hard work, but I’ve put together my own version of the child theme.

    I’ve removed any extra functions from template-tags.php to keep things simple and it seems to be working on my end so this might solve things.

    https://cloudup.com/cAzR640w-KE

    Thread Starter abzu2

    (@abzu2)

    Thank you for the replies and time dedicated to solve what i considered to be a fairly simple problem. I understand the logic and function of creating a child folder but the solution to what i want to do is seems far more complicated to solve with the child fodder than I had imagined. For whatever the reasons may be, modifying the files that Chris so kindly provided failed to produce the desired result. I therefore have activated Elucidate (not the child), modified the byline in template-tags.php rom By to Posted by and problem solved. Thank you for your kind efforts.

    Hi Abzu,

    Don’t give up best practices, the problem is easily solved, if it isn’t, something else must be going awry. Besides, you might want to make more changes down the line, and this would be much harder then.

    Chris’ theme is so clean and easy to use that I can attribute this going over the problem so long to the fact that we’ve tried to do things at a distance and without putting things on our own computer.

    I’ve replicated the issue on a testing site and the change you’re after has been applied immediately by following the instructions in my latest post.

    I’ve prepared a zip folder with both Elucidate and Elucidate child. Simply upload both (or just the child but then you need to put Elucidate parent back to the way it was) on your WP install and give it a try.

    I also activated the child on a staging WP site to demonstrate that the modification gets applied.

    Please, give it one more try, it’ll be worth it. Thanks.

    Download package:
    https://antonietta-designs.net63.net/elucidate-package.zip

    Staging site:
    https://antonietta-designs.net63.net/wordpress/

    I hope this solves the issue following WP best practices.

    Thread Starter abzu2

    (@abzu2)

    Antonietta,

    How sweet of you to go to all that trouble. There are 2 files in the elucidate-child folder:
    functions.php and styles.css

    ? Is it as simple as placing those 2 files in my child folder on my site and replacing those that I already have there, or are there other considerations ?

    Thank you for your effort.

    It’s just as simple as that, unless you have other files and folders that do some other job in the child theme. But, for what you want to achieve in the case at hand, it’s all you need.

    Thread Starter abzu2

    (@abzu2)

    Reminds me of:

    “If you can not understand that simple concept, you can never understand the complexity of simplicity.” ??

    Thread Starter abzu2

    (@abzu2)

    Tested. Eliminated the previously created template-tags.php file from the child folder and added the style.css + functions.php in your zip file. Activated elucidate-child. Works perfectly.
    Thank you to All for your kind replies.

    Yeah!!! I’m so glad it worked, you’re so very welcome.

Viewing 11 replies - 16 through 26 (of 26 total)
  • The topic ‘? Child Theme template for Elucidate ?’ is closed to new replies.