Display post by select it from a dropdown menu
To fix this issue, move the closing curly brace } for the foreach loop before the add_shortcode function, like this: function form_creation(){ ?> <select name=”page_id” id=”page_id”> <?php global $post; $args = array(‘cat’=>19); $posts = get_posts($args); foreach( $posts as $post ) : setup_postdata($post); ?> <option value=”<? echo $post->ID; ?>”><?php the_title(); ?></option> <?php endforeach; ?> <!– Move … Read more