[SOLVED] child themes or plugins? for tweaks I made to index.php in ATA
Okay, so you remember the good old days, when we could put php before, in, after the loop? Well, then WP got strict, forced ATA to turn this off. So I, like many, started hard-coding the tweaks into index.php. But then, with every ATA update, I get slightly annoyed and don't want to update, for the dread of editing my index.php yet again. There's got to be a better way.
I'm slowly learning of plugins, and got my header.php updated this way now. But, how do I do things like: Code:
<?php include("social-sitemenu.php"); ?> Code:
<?php bfa_next_previous_page_links('Top'); // For MULTI post pages if activated at ATO -> Next/Previous Navigation: ?> How do I replace this line of index.php: Code:
<?php bfa_post_headline('<div class="post-headline">','</div>'); ?> <!--original--> Code:
<?php if (!is_page()) {bfa_post_headline('<div class="post-headline">','</div>'); } ?> Or, lastly, how do I do this sort of stuff in the loop: Code:
<?php Thanks, Derek |
you could build a child theme - you'll need a copy of index.php and style.css
you have to edit style.css to 1 - change the name of the theme to whatever you want 2 - add a line in the comments HTML Code:
Template: Atahualpa HTML Code:
Template: Atahualpa379 You still will need to keep tabs of changes in index.php in case there are changes - I suggest you put another copy of index.php into the child theme folder and call it indexphp.base. Then when a new release of Atahualpa comes out you can compare the new index.php to indexphp.base to see if there were any changes. |
To minimize affects of changes by the main theme, is there a way to hook into the original index.php?
For example, instead of merely copying the entire index.php to my child theme, can I somehow filter or append (like add_action in wordpress): Code:
Code:
if ( is_front_page() ) { |
If you could, you would still be changing the index.php and have the same issue, you would need to compare it against the previous version
|
Okay, I understand. But just to confirm (sorry if I'm slow ;) ...
There's no way to hook into the theme with pre-existing function calls? At least, not in the case above? Thanks again! |
you can add new functions to the child theme by coding a function.php and adding the new code there - it will be added to the end of the themes function.php - BUT you have to edit the code somewhere else to call that new function.
you may want to read about child themes at wordpress.org or do a google search about them. |
Thanks, this was helpful. Using a child now on my test site, will make it live soon.
|
All times are GMT -6. The time now is 04:35 PM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.