Send notification to the admin when new custom post is submitted

EDIT – SOLUTION I got the solution using status ‘new_to_pending’ and adding the $auto object. function newpost_notify( $auto ) { $mailadmin = ‘[email protected]’; $subject=”Subject”; $headers=”MIME-Version: 1.0″ . “\r\n”; $headers .= ‘Content-type: text/html; charset=UTF-8’ . “\r\n”; $headers .= ‘From: xxx <[email protected]>’ . “\r\n”; $message=”There\”s a new post.’; wp_mail( $mailadmin, $subject, $message, $headers ); } add_action( ‘new_to_pending’, … Read more

Why does my content disapear when I make a page to match an archive name?

The WordPress template hierarchy is your friend. https://developer.wordpress.org/themes/basics/template-hierarchy/ This provides a very detailed flow for how WP determines which template to load. If you are ever uncertain about which template is loading, this little function is handy. Paste in your theme’s functions.php and it will display the template used at the bottom of the page. … Read more