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

Why can posts never have a number as the link?

Why Suffixes Are Appended to (Some) Numeric Post-Slugs WordPress posts can almost always have numeric permalinks, the exceptions being when they might conflict with another post, a feed, or a post post-type date archive, or are otherwise reserved. The wp_unique_post_slug() function mitigates these conflicts by appending a suffix. Potential date-archive conflicts arise when a numeric … Read more