• Hi, i am having a big problem trying to use php within pages.
    Is there any way to render php or even use the wp_tags inside pages.
    I mean that would be great no ned to worry anymore about dealing with plugins for static conten.
    What i’m trying to di is the following….

    <div id=”links-single”>

    <h2>Links:</h2>

      <?php get_links_list(); ?>

    </div>

    …so by placing that code inside the apge we would get a page with our blogroll, i ask you: is there anyway to do it?

    If not, how do i call a page with that code inside the themes directory.
    For example i have…

    …blogs\wp\13\wp-content\themes\themename\categories.php

    and i want to call that file… how can i do it?

    Thx in advance.

Viewing 2 replies - 1 through 2 (of 2 total)
  • You can’t, but you can.

    If you are trying to get WP to make the page, and putting the tags as the content to get your list, it will not work – WP messes the php somehow.

    But, if you create a standalone static page one that uses includes for the header / menu / footer (if needed) then the php will work as the WP engine doesn’t touch it.

    https://www.tamba2.org.uk/wordpress has info on creating a static page in such a way that PHP can be included.

    Thread Starter xmarcos

    (@xmarcos)

    Ok, now i’m less stupid today i was so bored that i started playing again with my wip layout on my pc and after looking at the code of the default layout i found out a way to make static pages (no plugins required).
    The only thing to do is place this code at the top of the page.

    <?php /* wp_php functions in a "static page"*/
    require('.../wp-blog-header.php');
    ?>

    And then u can use the “get” functions or use the php includes like this…

    <?php include "mod-headear.php"; ?>
    <?php include "mod-sidebar.php"; ?>
    <?php include "mod-footer.php"; ?>

    hope it work for u too

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘PHP in Pages (?!)’ is closed to new replies.