Multiple use wp_logout_url() on page cause 'header already sent' error after submit form

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;

?

Topic logout headers errors Wordpress

Category Web

About

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