[resolved] How to create a custom GET include (5 posts)

  1. mabjustmab
    Posted 3 years ago #

    I am building a custom theme, and there is a sizable chunk of code that is repeated on some of the templates (but not all). I want to create a custom <?php get_toolbox(); ?> file.

    1. is this possible?
    and 2. can anyone point me in the right direction?

    I thought about building a widget area, but it would be more complicated than a simple include on the templates I want it on vs. a custom plugin, custom widget area, additional plugin to set which pages it appears on, etc.

    Thank you for any help!

  2. marv51
    Posted 3 years ago #

    <?php include 'your_file.php'; ?> see the php manual here: http://www.php.net/manual/en/function.include.php

  3. mabjustmab
    Posted 3 years ago #

    Thanks Marv!
    I'll check it out today.

  4. Rev. Voodoo
    Volunteer Moderator
    Posted 3 years ago #

  5. mabjustmab
    Posted 3 years ago #

    @rev. Voodoo -> that was ~EXACTLY~ what I was looking for. thank you.

    for future ref: this was the line is was looking for -

    <?php get_template_part( 'nav' ); // Navigation bar (nav.php) ?>

Topic Closed

This topic has been closed to new replies.

About this Topic