Programmatically create page when saving custom post type post
Programmatically create page when saving custom post type post
Programmatically create page when saving custom post type post
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
remove post that has no content
Running code before object-cache.php runs
I see a couple of things. First your missing the closing bracket for your js function. Also, in WP you need to use jQuery() rather than $() for jQuery calls. Finally, make sure your script is inside a jQuery(document).ready(function() { });block.
This is pretty easy to do. Put this code in your functions.php file. The logic is pretty straightforward. Get all posts with get_posts(). Iterate over all post, extract comments count and permalink of current post and Print out the results. . add_action( ‘init’, ‘get_comments_count’ ); // Hook to init, elsewhere or use directly in your … Read more
Problem custom control Customizer
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
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
I’m guessing this is a css loading issue. The website loads all the resources before loading the style sheet that hides your sub menus (in your case dropdowns.less). Enqueuing .less in wordpress is done a bit different than you would enque a normal css stylesheet so you should check this out. If this is indeed … Read more