WPNetwork with custom URL Rewrite rules

First, I didn’t flush the rewrite rules so, or course, the rule wasn’t being included. Second, I ended up going with a MUCH simpler solution to passing the variable to any page with the template applied, which was add_rewrite_endpoint. add_action(‘init’, ‘my_add_endpoints’); function my_add_endpoints() { add_rewrite_endpoint(‘myendpoint’, EP_PAGES); } !IMPORTANT – add_rewrite_endpoint registers a query var for … Read more

Enqueueing Script to footer puts it at the very bottom

You want something like this. // assuming you want to load this only on frontend if ( ! is_admin() ) add_action( ‘wp_enqueue_scripts’, ‘wpse_112876_load_scripts’ ); function wpse_112876_load_scripts() { wp_enqueue_script( ‘my_foundation’, get_template_directory_uri() . ‘/js/foundation.min.js’, null, ‘4.3.3’, true ); wp_enqueue_script( ‘my_foundation_init’, get_template_directory_uri() . ‘/js/foundation_init.js’, array( ‘my_foundation’ ), null, true ); }

Add Custom Post Type on the Fly or create an array

use $wp_insert_post function to create posts and to create sub posts of this use this function again and set post_parent = “name of post you created” see list of all arguments and usage of this function wp_insert_post