Hi,
I have to insert content blocks in many different places (some on all single pages/posts, some only on some custom post types) – so I thought doing that via the predefined gp hooks and to define all the conditional statements inside my child theme functions.php (because the code will be long and wont fit well into the hooks fields in the GP Hooks interface).
I know this must be trivial, but I always kill my wordpress install when trying to do this 🙁
(white screen of death)
I have added this to my funtions.php
// insert Image credit into all single posts, events, pages etc
add_action( 'generate_after_entry_content', 'add_imgcredit' );
function add_imgcredit(){
if ( is_singular() ) {<div class="imagecredits"><?php the_field('image_credits'); ?></div>}
}
ps. I have used Advanced Custom Fields to set up the extra fields…
Any tips on how to do this correctly? Thanks!