Blog

Changing the menu wrapper

Changing the menu wrapper

class Nav_Walker_Nav_Menu extends Walker_Nav_Menu{ function start_el(&$output, $item, $depth, $args){ global $wp_query; $indent = ( $depth ) ? str_repeat( "\t", $depth ) : ''; $class_names = $value = ''; $classes = empty( $item->classes ) ? array() : (array)...

Adding a custom class

Adding a custom class

function my_class_names($classes) { // add 'class-name' to the $classes array if( !is_front_page() ) $classes[] = 'not-front'; if( is_single() ) $classes[] .= 'et_full_width_page'; if(($key = array_search('et_right_sidebar', $classes)) !== false) {...

Adding a new image in WordPress

Adding a new image in WordPress

To add a custom image size to your WordPress simply add the following code to your functions.php In addition to creating the image size, the filter will also make the image available in the editor so that you can select it. Finally, make sure that you regenerate the...