Only seems to be displaying one child when there are supposed to be multiple

Assuming you want to show the terms of just one taxonomy at a time, then this will produce what you’re looking for: function my_theme_get_child_terms(){ $return = ”; $current_term = get_queried_object()->term_id; $term_info = get_term($current_term); $sub_categories = get_term_children( $current_term, $term_info->taxonomy ); $return .= ‘<h2>’ . $term_info->taxonomy . ‘</h2><ul>’; foreach ( $sub_categories as $cat ) { $term = … Read more

Restrict certain roles registrations by domain

You’ll want to checkout the registration_errors filter. Make sure the role is being posted within the particular registration form. Instead of conditionally adding your action you have to check within the filter if role and email are valid. add_action( ‘registration_errors’, ‘wpse_248123_registration_errors’ ); function wpse_248123_registration_errors( $sanitized_user_login, $user_email, $errors ) { if ( empty( $_POST[‘role’] ) ) … Read more

Surrond h1 entry-title automatically with a span tag

You could either add the span in your template file like this: <h1><span><?php the_title() ?></span></h1> Or you could add a filter to manipulate the output like this: add_filter(‘the_title’, function ($title) { $title=”<span>” . $title . ‘</span>’; return $title; });

How to disable site title and description when custom header is uploaded on the customizer?

<div class=”table-cell”> <?php if ( has_custom_header() ) : ?> <?php the_custom_header_markup() ?> <?php else : ?> <h1 class=”blog-title”><?php bloginfo(‘name’); ?></h1> <h5 class=”blog-tagline”><?php bloginfo(‘description’); ?></h5> <div class=”image-title”><img src=”https://wordpress.stackexchange.com/questions/248807/<?php bloginfo(“template_url’); ?>/images/image.png” /></div> <?php endif ?> </div>

TinyMCE Multiple Custom Classes Selections

Ok, I found the correct format for this TinyMCE issue which also retain some of the original Style Format selections. Enjoy! function my_wpeditor_buttons( $buttons, $editor_id ) { if ( ‘content’ != $editor_id ) { return $buttons; } array_unshift( $buttons, ‘styleselect’ ); return $buttons; } add_filter( ‘mce_buttons_2’, ‘my_wpeditor_buttons’, 10, 2 ); function my_wpeditor_formats_options( $settings ) { … Read more