an
groups-icon

Why require_once instead of get_template_part ?

Wait a minute... This content is very very old. We no longer sell or support this theme version. New Topics
  • Version 9
    Miguel Ayala
    0 points
    Beginner

    Hi guys!

    Why do you use require_once (a) to load framework files instead get_template_part (b)?

    a) require_once TEMPLATEPATH .”/framework/class/class_widgets.php”;

    b) get_template_part( ‘framework/class/class_widgets’ );

    If you’d use get_template_part, framework classes could be customized easier by child themes.

    Why don’t you allow to customize core files? https://www.premiumpress.com/forums/topic/customized-core-files-not-working-in-child-theme/#post-27931

    I know (almost) everything can be done with the Actions & Filters API https://www.premiumpress.com/forums/topic/customized-core-files-not-working-in-child-theme/#post-27938, but this little change (using get_template_part) could do everything easier, and that way we can choose when to use hooks and when to overwrite core files. Remember, WordPress child themes are meant to overwrite parent functionality.

    Thanks

    May 7, 2015 at 8:56 pm
  • Mark Fail
    11,845 points
    Platinum User
    Bronze User Silver User Gold User Platinum User Helpful Award Fast Responder Thank You Coffee Villian Award Video Testimonial
    Members Only Content

    This reply is for PremiumPress customers only.

    Login Now
    May 8, 2015 at 6:59 am
  • Mark Eting
    0 points
    Beginner
    Members Only Content

    This reply is for PremiumPress customers only.

    Login Now
    May 8, 2015 at 9:42 am

593

Views

2

Replies