Skip to content

Instantly share code, notes, and snippets.

@mrdavefoy
mrdavefoy / add-image-size.php
Created April 1, 2018 18:05
Add custom image size in WordPress
add_image_size( 'content', '800', '9999', false );
@mrdavefoy
mrdavefoy / add-size-dropdown.php
Last active April 7, 2018 15:10
Add new image size to Size dropdown
function my_custom_sizes( $sizes ) {
return array_merge( $sizes, array(
'content' => __( 'Content' ),
) );
}
add_filter( 'image_size_names_choose', 'my_custom_sizes' );
/* GeneratePress Header fix for problem break points
Change the 900px value in two places to where you have nav/logo overlap */
@media(min-width:769px) AND (max-width:900px) {
.inside-header {
display: flex;
flex-flow: row wrap;
justify-content: center;
}
#site-navigation {
min-width: 900px;
add_action( 'template_redirect','tu_add_elementor_filter', 999 );
function tu_add_elementor_filter() {
if ( in_array( 'elementor-page elementor-page-' . get_the_ID(), get_body_class() ) ) {
add_filter( 'body_class', 'tu_add_elementor_classes' );
add_filter( 'generate_show_title','__return_false' );
}
}
function tu_add_elementor_classes( $classes ) {
$classes[] = 'full-width-content';