Get_header raises an 500 internal server error

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 "h1loren 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 "h1loren ipsum/h1";
  get_footer();
 ?

Topic template-tags errors theme-development Wordpress

Category Web


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


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


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.

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.