Tag Info

Hot answers tagged

3

You are deleting all pages with that code because you are triggering the function wp_delete_post(). You should build the url to delete the page(or post) like this: $delLink = wp_nonce_url( get_bloginfo('wpurl') . "/wp-admin/post.php?action=delete&post=" . $page->ID, 'delete-post_' . $page->ID); So your code should be: $pages = get_pages(); ...


2

You probably have an action to 'pre_get_posts' that it's excluding the page post-type. Paste that code here, so we can help you.


2

This is actaully a naming clash. Wordpress uses the word order in its core as a sorting function, and is also a reserved name that should not be used by themes or plugins Changing your custom post type name to orders will fix your problem


2

order is a reserved term, the best - I know of - overview over those can be found here: Codex: register_taxonomy() - Reserved Terms. The list is in it's relevance not restricted to taxonomies. The introduction to it does make it clear(er) why: Avoiding the following reserved terms is particularly important if you are passing the term through the $_GET or ...


1

You can add OR conditions like this. <?php if ( is_front_page() || is_archive() || is_search() ) {?> <div>Flash Gordon</div> <?php } ?>


1

WordPress uses sanitize_title to create the URL-friendly version of titles for use as post slugs, which has sanitize_title_with_dashes hooked to the sanitize_title filter. You can see sanitize_title in use in source for wp_insert_post here, and sanitize_title_with_dashes in source here.


1

Assuming that you're on a page template or a custom page template, the first thing you want to do is grab the current page ID, then use that ID to grab the children. Once you have the children, display the content for those children. Try using get_children(); You can also try get_page_children but for my example, I'm using get_children: <?php ...



Only top voted, non community-wiki answers of a minimum length are eligible