How to know which PHP file is the static page ?

  • Author
    Posts
  • #57895

    Hey !

    First, I’m using the Parabola theme ( thanks a lot for the theme, it’s the best one I’ve found ! )

    I tried to edit many php files ( including page.php, index.php and a few others ) to try to create a custom static page. Basically on WordPress I selected the ” Static page ” box to display a static page instead of the list of the most recent articles ( since there isn’t any article, it’s just a website for a live fish retailer ), but now it’s just a default static page with a default text.

    I need to insert pictures, text etc.. that’s why I’d like to know what the exact file is, and not just the dashboard’s form, so that I can write HTML code.

    So if you have any idea what the file is, I’ll take it 🙂

    Thank you !

    #57956
    Zed
    Cryout Creations mastermind

    In WordPress one file handles multiple usage cases. For example in Parabola page.php will render *all* static pages. The pages (and other content elements, like posts) themselves are stored by WordPress in the database, not files.

    If you’re looking to customize a single content element beyond what the dashboard editor can do ( even with additional plugins), you can use the template hierarchy map to identify which file will be used to render that particular content element:

    You normally start by copying the default handler file from the theme to your child theme and customizing it from there.


    If you like our creations, help us share by rating them on WordPress.org.
    Please check the available documentation and search the forums before starting a topic.
    #57991

    Thanks for your answer !

    But I’m not sure I really get it.
    Before posting I tried to modify the page.php to remove the sidebar ( which is not needed when one is on the static front page ), and eventually I ended up removing the part that displays the content to start from scratch. But obviously it means that if I create another post, it won’t have a sidebar.

    So do you mean I have to create another $custom.php ( named something like static-page.php ) ? If yes, how do I tell WP to use static-page.php as the front page ?

    #58372
    Zed
    Cryout Creations mastermind

    Use the page-$slug.php or page-$id.php filenames to target a specific static page (by slug or numeric ID).


    If you like our creations, help us share by rating them on WordPress.org.
    Please check the available documentation and search the forums before starting a topic.
Viewing 4 posts - 1 through 4 (of 4 total)

The topic ‘How to know which PHP file is the static page ?’ is closed to new replies.