• I want to display in one of my pages (created through Page.php) a summery of latest activity in several categoris in my blog, but in a unique layout. In that summery page you can see the name of a certain category, number of posts, latest update and descripition of the category.

    So I created the layout and opened a new page with the neccessary wordpress code. But all of it doesnt work in Page.php!!!!

    But … when I place this code in archive.php (for example) it works, which means that wordpress code cannot be used in Page.php.

    How can I make wordpress code work in Page.php????

Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator Samuel Wood (Otto)

    (@otto42)

    WordPress.org Admin

    What is “Page.php”? Is it a page template you’re using for a static page? Or is it something you made, outside of WordPress entirely, that you’re loading directly?

    If it’s going through wordpress, like the archives page or a static page or something, then it should all work.

    If it’s something you made and are calling directly, you need to add require('wp-blog-header.php'); to the top of your code.

    hahahaha wordpress code can be used anywhere wordpress can see it!

    if you saved it as a template, make sure you include:
    <?php /* Template Name: Title */ ?>

    at the top of the document. this allows wp to recognize this as a template. then make sure you set the page to use the template! if you don’t set the template, it will just use the default “page.php” file.

    Hi all
    I ‘m also looking for a page that would list the entire archives includind the threads from the wp_forum plugin. That’s why I intend to create a page including php code. My first try isn’t working. Is there any precise on creating a page including php code ?
    Thanks in advance

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to use wordpress code in Page.php?’ is closed to new replies.