• Hello guys,

    Note: I managed to show my content generated by my php file into my “Reviews”-page. I basically added the HTML code from the “Reviews”-page into my “reviews.php”-file. But here is the next problem: The CSS is not shown. Should I add the CSS with an <link> tag into my php file? I think, my php file (which will include php, html and css) will be to bloated.

    I’ll keep it short:
    – I created a WordPress page “Reviews”, this page includes HTML code (+CSS from a plugin)
    – I created a PHP file “reviews.php”, which includes PHP code, loops, variables etc.
    – In my reviews.php I added on the very beginning

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

    to have access to this file via page attributes. Accordingly
    the template “reviews” appears there, all fine.

    I assumed if I view the preview of the page “Reviews” I’ll see the page like I have on my local machine. But what I see is a blank page. Nothing in.
    Do you guys have an idea?
    Thanks a lot. I already worked with WP, but this task is a bit more difficult. Seems like.

    • This topic was modified 5 years, 6 months ago by duedeu36.
    • This topic was modified 5 years, 6 months ago by duedeu36.
Viewing 5 replies - 1 through 5 (of 5 total)
  • Hello @duedeu36,

    If you are seeing a blank page, it may be the white screen of death, and it means that your code isn’t working correctly. I’d advise you to define the WP_DEBUG to true and check if any error was shown on the page.

    Please do let us know if it helps.

    Thread Starter duedeu36

    (@duedeu36)

    Hey @matheusfd, thanks for the advice. I read about the white screen of death, but this wasn’t the issue. I just updated my original post. ??

    • This reply was modified 5 years, 6 months ago by duedeu36.
    • This reply was modified 5 years, 6 months ago by duedeu36.

    Its hard to assume how you are doing it, but try to figure out what error it through. try enabling debug mode true and php error log too.

    Is it working now @duedeu36 ?

    Thread Starter duedeu36

    (@duedeu36)

    @matheusfd It does! I uploaded my style.css via FTP to my wp-content folder (the place where I have my theme) and added my style.css with
    <style> <?php include 'style.css'; ?> </style> into my “reviews.php”-file.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Blank page after including php code into my .php file’ is closed to new replies.