• erikiva

    (@erikiva)


    I am trying to use exray with a child theme but it doesn’t seem possible without basically copying all the files over and modifying them.
    I want to change the function that opens the main content part get_exray_content_html_opening but if I create it in the child theme it tells me it is already defined, since it isn’t declared with if ( ! function_exists

    So the alternative seems to be to create a diferent function with the modifications but this function is called in all the template files ie: index.php, page.php, category.php etc…so basically I might as well just modify the original template.

    Anybody has a different suggestion?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Edde Poon

    (@partyforeplay)

    The reason you dont modify the original template is the fact that when a theme is updated you lose all your modified css. Your child theme is protected from updates.

    You can still copy all files to your child theme folder and edit from there.

    Thread Starter erikiva

    (@erikiva)

    I know, what I meant is that if I override all the files there won’t be much point in making updates.

    Moderator Jan Dembowski

    (@jdembowski)

    Forum Moderator and Brute Squad

    but it doesn’t seem possible without basically copying all the files over and modifying them.

    That really depends on what you want to change.

    I want to change the function that opens the main content part get_exray_content_html_opening but if I create it in the child theme it tells me it is already defined, since it isn’t declared with if ( ! function_exists

    *Looks at theme*

    That’s unfortunate. If that function was added via a filter or action then you could remove it from the queue so that it doesn’t fire. But it’s embedded in the following templates.

    attachment.php:10:		 <?php get_exray_content_html_opening(); ?>
    category.php:10:        <?php get_exray_content_html_opening(); ?>
    functions/exray-theme-template.php:304:function get_exray_content_html_opening(){
    index.php:14:        <?php get_exray_content_html_opening(); ?>
    page-archives.php:15:	        <?php get_exray_content_html_opening(); ?>
    page.php:10:        <?php get_exray_content_html_opening(); ?>
    search.php:10:        <?php get_exray_content_html_opening(); ?>
    single.php:10:		 <?php get_exray_content_html_opening(); ?>
    tag.php:10:        <?php get_exray_content_html_opening(); ?>

    What change are you trying to accomplish? Their may be other ways to pull that off without copying all of those files.

    Thread Starter erikiva

    (@erikiva)

    Yep, exactly, that’s the problem it is neither done with if !funtion not atached to hooks or filters so in fact I can’t redifine it, just have all thos templates call another funcion and stop calling that one.
    I want to insert a widget area above the main content. I’ll try with maybe a before_loop hook? Would that work?

    Either way I’ll have the same problem with any layout change because it is mostly done like that with direct calls to functions.

    Moderator Jan Dembowski

    (@jdembowski)

    Forum Moderator and Brute Squad

    Do you want it to be after the head portion and before the loop?

    Thread Starter erikiva

    (@erikiva)

    I have the layout with right and left columns and I want it above the main column/content.
    I tried below the header so I only had to change the header but that pushes down not only the middle main column but also the sides leaving white spaces above the side columns..

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Child theme for exray’ is closed to new replies.