How to exclude/filter a tag from get_the_tag_list()

function mytheme_filter_tags( $term_links ) { $result = array(); $exclude_tags = array( ‘some tag’, ‘another tag’, ‘third tag’ ); foreach ( $term_links as $link ) { foreach ( $exclude_tags as $tag ) { if ( stripos( $link, $tag ) !== false ) continue 2; } $result[] = $link; } return $result; } add_filter( “term_links-post_tag”, ‘mytheme_filter_tags’, 100, … Read more

Using hooks to place content in theme dynamically

If you’re the parent theme Developer, you can add the hook in your parent themes file and then use it in a custom function in your child theme. 1. Add Hook To Parent Themes File <?php do_action( ‘after_wp_footer’ ); ?> 2. Create Function For New Hook in Parent Theme function create_after_footer_hook() { do_action(‘after_wp_footer’); } 3. … Read more

Change default settings used by gallery shortcode

The shortcode_atts_{$shortcode} filter allows default parameters to be modified for shortcodes. To modify the shortcode, we’ll use the shortcode_atts_gallery filter. Here is an example that changes the defaults for the columns and link parameters in the shortcode. Note that if the user specifies values for these parameters, those values will be used; we’re just changing … Read more

Allowing non-latin characters in registration

Try this (not tested, I hope I am not short circuiting it into endless loop): add_filter(‘sanitize_user’, ‘non_strict_login’, 10, 3); function non_strict_login( $username, $raw_username, $strict ) { if( !$strict ) return $username; return sanitize_user(stripslashes($raw_username), false); }

Load different template file when condition met?

Can you perform the logic on the template_include filter? Else, you could set a global/constant and use that in template_include to serve up the appropriate template. The template_include filter filers the path to the template file to be included. To avoid errors you should check if the template exists – locate_template does this for theme/child-theme … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)