Wordpress Themes - WP Forum at BFA
Click here to register or to donate.
Auto self-registration is not available here - far too many spammers. This forum has many, many backlinks and because of that there is an intense desire among spammers to drop their links here.

Wordpress Themes - WP Forum at BFA » WordPress Themes » Montezuma Theme »

Adding a php code in the theme?

Old Aug 30, 2013, 06:01 PM
4 posts · Dec 2008

i read many threads so i tried doing this:

i have one subtemplate called ads.php
there i have this (only for tests)
echo "Hello World";

then as i want it to appear in every post after the pagination i have this at single.php in main templates section:

PHP Code:
        <?php comments_template''true ); ?>

        <nav class="singlenav cf">
            <div class="older"><?php previous_post_link(); ?></div>
            <div class="newer"><?php next_post_link(); ?></div>

            <?php bfa_get_template_part'ads' ); ?>
    <div id="widgetarea-one" class="col4">
        <?php dynamic_sidebar'Widget Area ONE' ); ?>

But im not seeing the hello world at any post,

can someone help me?

I just need to add some php code to render in posts or if simpler in all site.

Thank you

PS: i tried to include an outside php file but i had the same result
Old Aug 30, 2013, 07:49 PM
juggledad's Avatar
23,694 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
1) you can't add just any php into a virtual template - click the 'Limited PHP Code' tab at the top right of the screen
2) use the format
HTML Code:
<?php bfa_get_template_part( 'ads', '' ); ?>


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
Thread Thread Starter Forum Replies Last Post
adding php code in footer _kimberley Header configuration & styling 7 Dec 19, 2011 04:52 AM
Adding code for ads or other sites (newbie when it comes to code issues!) gardentravelbuzz Plugins & Atahualpa 7 Feb 7, 2011 05:43 AM
Adding some code Steve_T Atahualpa 3 Wordpress theme 9 Feb 7, 2009 05:28 PM

All times are GMT -6. The time now is 06:00 PM.

Powered by vBulletin® Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.