admin管理员组

文章数量:1389749

I am working on custom development in wordpress, my problem is the following every time I create a new template.

Code

 /* Template Name: Citas Rolex*/
 get_header();

echo "<h1>loren ipsum</h1>";

get_footer();

It gives me the following error in the user view

In browser

Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator to inform of the time the error occurred and of anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

I miss that when I comment on get_header () the view works perfectly for me

/* Template Name: Citas Rolex*/
//get_header();
 echo "<h1>loren ipsum</h1>";
  get_footer();
 ?>

I am working on custom development in wordpress, my problem is the following every time I create a new template.

Code

 /* Template Name: Citas Rolex*/
 get_header();

echo "<h1>loren ipsum</h1>";

get_footer();

It gives me the following error in the user view

In browser

Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator to inform of the time the error occurred and of anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

I miss that when I comment on get_header () the view works perfectly for me

/* Template Name: Citas Rolex*/
//get_header();
 echo "<h1>loren ipsum</h1>";
  get_footer();
 ?>
Share Improve this question edited Mar 11, 2020 at 10:57 fuxia 107k39 gold badges255 silver badges459 bronze badges asked Mar 11, 2020 at 8:23 Luis BernalLuis Bernal 1 2
  • Are you using an opening <?php tag? – KiwisTasteGood Commented Mar 11, 2020 at 11:53
  • How exactly are you using this template? If get_header() is causing a 500 error, it could mean that the function doesn't exist, because it's being accessed incorrectly. In that case get_footer() would also cause the exact same problem, but you wouldn't notice because it runs after your placeholder text. – Jacob Peattie Commented Mar 11, 2020 at 13:42
Add a comment  | 

3 Answers 3

Reset to default 0

If you want to create one template in WordPress, Please see below example

  <?php /* Template Name: CustomPageT1 */ 
    get_header();
    echo "hello this is my custom template";
    get_footer();
   ?>

Try this code.

I already have the template created, and it gives me error 500, but when I comment on get_header the error 500 is resolved, but on the get_header of all the menus. and if I don't have the get_header I can't use the headers I have for that headers. and I don't know how to fix it

I think you may be overthinking this. Isn't the 500 error a page size issue? I get those issues in Elementor when there's too much on a page and the server times out. You need to adjust the php.ini file to increase size limit. We can explain that or you can do a simple google search but this needs to be done in a FTP transfer program like filezilla or cyberduck. Hope that helps

本文标签: theme developmentGetheader raises an 500 internal server error