Insert php code before get_header

hello, i need help :slight_smile:

i have custom query and if there is no posts shown page is redirected to another page like this

<?php else : wp_redirect( get_permalink ( 717 ) ); die; ?>

but, for that to work i need to insert

<?php ob_start(); ?>

before

<?php get_header(); ?>

question is: is there any way to insert it within pinegrow so i don’t need to copypaste it every time after page is exported/overwritten?

thank you very much

@matjaz @RobM @Emmanuel is this even possible? To put something before <?php get_header(); ?>

@fogseller it might be possible to add it at the start of the header. Would that help?

Alternative would be adding the call into a WP action handler (not sure which action that would be) in inc/custom.php so that you won’t have to manually edit exported files.

1 Like

Something like this maybe :

2 Likes

hey, thank you. i will try all options and write what worked :+1: