How to show category images (from plugin) on a regular page (page-example.php)?

Untested, but something like this should work. $siteurl = home_url(“https://wordpress.stackexchange.com/”); $tax = ‘region’; // slug of taxonomy $terms = get_terms($tax); foreach ($terms as $term) { $id = $term->term_id; $slug = $term->slug; $description = $term->description; $image_url = z_taxonomy_image_url( $id, NULL, TRUE ); $link = “<a href=”https://wordpress.stackexchange.com/questions/176555/$siteurl?$tax=$slug” ><h1> $term->name </h1></a>”; echo $link; echo ‘<p>’ . $description . … Read more

Edit menu item title from edit page/post

Whenever you add a new item to WordPress Menu ( Appearance -> Menu ) it creates a new Post of Post Type nav_menu_item and gets assigned a post meta called _menu_item_object_id with the main Post ID. For example, if I create a page called “Home” it gets assigned a Post ID of 2. Now, when … Read more

Replace existing pages with new pages, keep menu links

I was shocked to see that such a simple thing is not readily supported. I was even more shocked to see that no one had a good answer here on StackExchange! Happily, I found this post: https://wordpress.org/support/topic/updating-current-page-with-new-built-page/ …and am grateful for the answer provided by Joy (@joyously on WordPress.org and Slack) “If you need to … Read more

Given the page id, check if it has children

The example from the WP codex for get_page_children does what you are looking for with a page titled “Portfolio”: $my_wp_query = new WP_Query(); $all_wp_pages = $my_wp_query->query(array(‘post_type’ => ‘page’, ‘posts_per_page’ => ‘-1’)); // Get the page as an Object $portfolio = get_page_by_title(‘Portfolio’); // Filter through all pages and find Portfolio’s children $portfolio_children = get_page_children( $portfolio->ID, $all_wp_pages … Read more

How to create taxonomy values for pages and list them in wp-admin

This is definitely possible, and pretty easy too! If you’d like to register an existing taxonomy (i.e. category) with an existing post type (i.e page), register_taxonomy_for_object_type() can be used. E.g.: add_action( ‘init’, ‘wpse_register_category_tax_for_page’ ); function wpse_register_category_tax_for_page() { $taxonomy = ‘category’; $object_type=”page”; register_taxonomy_for_object_type( $taxonomy, $object_type ); } A new taxonomy can be created and associated with … Read more

Check whether the child page has siblings

Of course it is possible. Just take a look at docs for wp_list_pages So something like this will do the trick: <?php global $post; // assuming there is global $post already set in your context wp_list_pages( array( ‘exclude’ => $post->ID, // exclude current post ‘parent’ => $post->post_parent // get only children of parent of current … Read more