How to get category and archive title?

For category use single_cat_title function: http://codex.wordpress.org/Function_Reference/single_cat_title For tag use single_tag_title function: http://codex.wordpress.org/Function_Reference/single_tag_title For date use get_the_date function: http://codex.wordpress.org/Function_Reference/get_the_date For example if you open twentyten theme you will see following: category.php: <h1 class=”page-title”><?php printf( __( ‘Category Archives: %s’, ‘twentyten’ ), ‘<span>’ . single_cat_title( ”, false ) . ‘</span>’ ); ?></h1> date.php: <h1 class=”page-title”> <?php if ( … Read more

WooCommerce: List All Categories

taken from that very same function: // prior to wordpress 4.5.0 $args = array( ‘number’ => $number, ‘orderby’ => $orderby, ‘order’ => $order, ‘hide_empty’ => $hide_empty, ‘include’ => $ids ); $product_categories = get_terms( ‘product_cat’, $args ); // since wordpress 4.5.0 $args = array( ‘taxonomy’ => “product_cat”, ‘number’ => $number, ‘orderby’ => $orderby, ‘order’ => $order, … Read more

Gutenberg editor add a custom category as wrapper for custom blocks

Digging myself deeper in documentation, I got the following result. There is a way to group your custom blocks around a given category in Gutenberg, and therefore we have the method block_categories_all. So with a filter, you can extend the default categories with custom ones. Here is my example: add_filter( ‘block_categories_all’, function( $categories, $post ) … Read more

How would I get a taxonomy/category list inside a Gutenberg block?

Load the elements into a constant using a function like this: const postSelections = []; const allPosts = wp.apiFetch({path: “/wp/v2/posts”}).then(posts => { postSelections.push({label: “Select a Post”, value: 0}); $.each( posts, function( key, val ) { postSelections.push({label: val.title.rendered, value: val.id}); }); return postSelections; }); Then use postSelections as your element “options”. el( wp.components.SelectControl, { label: __(‘Select … Read more

deneme bonusu veren sitelerbahis casinomakrobetceltabetpinbahispolobetpolobet girişpinbahis girişmakrobet girişpulibet girişmobilbahis girişkolaybet giriş