Custom Image Size in Insert Media

I ended up doing this: add_filter( ‘image_size_names_choose’, ‘jss_custom_image_sizes’ ); function jss_custom_image_sizes( $sizes ){ $custom_sizes = array( ‘customsize1’ => ‘Post Rectangle Image’, ‘customsize2’ => ‘Post Square Image’, ); return array_merge( $sizes, $custom_sizes ); }

How to pass hook variable to function?

You can’t use an action or hook within a function in the way you are expecting. Actions and hooks are about delayed execution You are attaching code that will execute at a later point. After an action is added, your function will continue as normal. Then when the user is actually being registered, your code … Read more

Show Featured Image in else statement

The featured image-related functions do not offer any way to define a default/fallback image. So, you’ll have to define one yourself, e.g. <?php $featured_image = ( ” != get_the_post_thumbnail() ? get_the_post_thumbnail() : get_template_directory_uri() . ‘/images/img_not_available.png’ ); ?> <a href=”https://wordpress.stackexchange.com/questions/118789/<?php the_permalink(); ?>”><?php echo $featured_image; ?></a> Edit Three changes: More explicit conditional. get_the_post_thumbnail() returns an empty string … Read more

Could not add ‘LoginLogout’ link using BAW login logout plugin

Have you tried printing your custom link just by checking if user is logged in? you can do this using bult in wp functions <?php if ( is_user_logged_in() ) { echo ‘<a href=”‘.wp_logout_url( get_permalink() ).'” title=”Logout” class=”hunderline”>Logout</a>’; } else { echo ‘<a href=”‘.wp_login_url( get_permalink() ).'” title=”Login” class=”hunderline”>Login</a>’; } ?>