Multiple use wp_logout_url() on page cause ‘header already sent’ error after submit form
Question
I am using two wp_logout_url()
echoes on page.
The first one is used in header.php custom theme file, second one is used in another page template file (page-[customslug].php).
On that page i have a form to edit user profile data.
Sending this form cause on result page “headers already sent” error.
To avoid this problem i must remove one from those two lines where i use <?php echo wp_logout_url(); ?>
.
<?php
get_header(); <--- first wp_logout_url();
/* page-[custom-slug].php content */ <--- second wp_logout_url();
get_footer;
?>
Why i can’t use multiple logout links on one page?
IMPORTANT:
This is how i retrieve the sended form data:
<?php
if ( isset($_POST['btnname']) ) :
// saving data stuff
else :
// page-[custom-slug].php content
endif;
?>
0
10 months
2022-03-21T20:40:36-05:00
2022-03-21T20:40:36-05:00 0 Answers
0 views
0
Leave an answer