How does wp_enqueue_scripts work?

Thanks for rewriting the question: It seems much clearer now. Sorry for the protracted comments earlier, but I wasnt on my laptop. I corrected a couple of typos in your code and pasted this into my functions.php: // include files via shortcode function include_file($atts) { extract(shortcode_atts(array(‘filepath’ => NULL), $atts)); if ($filepath!=’NULL’ && file_exists( trailingslashit( get_stylesheet_directory() … Read more

Create highly customized submenu (possibly using wp_list_pages)

After days of working on this, I was able to loop through the results of wp_list_pages to customize the menu the way I needed. <?php if(count(get_post_ancestors($post->ID)) == 1 ) { echo ‘<ul>’; $args = array( ‘post_type’ => ‘page’, ‘post_status’ => ‘publish’, ‘posts_per_page’ => -1, ‘post_parent’ => $post->post_parent, ); $query = new WP_Query($args); while ($query->have_posts()) { … Read more

How to target grandchild of post_parent using wp_list_pages

The correct answer is: $Pages = wp_list_pages(‘child_of=”.($post->post_parent != false ? $post->post_parent : $post->ID).”&title_li=&echo=0&depth=1’); $InnerPages = wp_list_pages(‘child_of=”.($post->post_child != false ? $post->post_child : $post->ID).”&title_li=&echo=0′); $Title = ($post->post_child != false) ? trim(get_the_title($post->post_child)) : trim(wp_title(”, false)); if($Title != ”) $Pages = str_replace($Title.'</a></li>’, $Title.'</a>’. ‘<ul id=”test”><li>Overview</li>’.$InnerPages.'</ul></li>’, $Pages); echo $Pages; unset($Pages, $InnerPages); HOWEVER, I have found a much better solution to … Read more