0

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();
 ?>
  • Are you using an opening <?php tag? – KiwisTasteGood Mar 11 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 Mar 11 at 13:42
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.

| improve this answer | |
  • 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 – Luis Bernal Mar 11 at 16:15
0

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

| improve this answer | |
0

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

| improve this answer | |
  • I am not using any page builder, I am doing it from scratch, as a base I am using underscores, the question is that when I comment the get_header (); the page if it goes well for me. – Luis Bernal Mar 12 at 8:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.