WordPress.org

Ready to get started?Download WordPress

Forums

How to get my custom.php into the entry text like single.php does? (3 posts)

  1. thupten
    Member
    Posted 4 years ago #

    Can anybody please help me or point me to a tutorial that shows how to include a custom php file as a single page.

    I have a custom.php which contains php code to get some news feed from google and I want to display it in the article content area.

    Do I have to edit single.php? or include my custom.php into single.php?

    thanks alot.

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

    you want it as a page?

    make a copy of page.php and name it whatever you like say... custom.php

    it will already have the loop to display page content. Add in your custom code where you would like

    include the header

    <?php
    /*
    Template Name: Custom
    */
    ?>

    at the very top

    Now make your new page from the add new page menu, and assign the Custom page template to it

  3. thupten
    Member
    Posted 4 years ago #

    Rev. Voodoo. Thanks a lot. it worked.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags