Featured Image Size Conditional Tag?

Is it possible to check what image size has been selected for the featured image and only display that image.. For example. <?php if(has_post_thumbnail(‘small-image’)): ?> <?php the_post_thumbnail(‘small-thumb’) ?>small image is showing <?php elseif(has_post_thumbnail(‘full-thumb’)): ?> <?php the_post_thumbnail(‘full-thumb’) ?>large image is showing <?php endif ?> <?php the_post_thumbnail() ?>default image if none selected Not sure if that makes … Read more

is_page_template not working as expected

I’m trying to serve different headers based on what type of page the user is on. This is my code. <!– IF HOME –> <?php if ( is_front_page() && is_home() ) : ?> <?php get_template_part( ‘template-parts/headers/home-header’ ); ?> <!– IF TEMPLATES –> <?php elseif ( is_page_template(‘archive-mobile_photo.php’) ) : ?> <?php get_template_part( ‘template-parts/headers/home-header’ ); ?> <!– … Read more

Check if current page is wp-admin

I have created a common custom dashboard for my users located at “http://website.com/login/dashboard/” I’m trying to redirect users to that custom dashboard only if they are NOT admins & if the page IS http://www.website.com/login/wp-admin/ The redirection function I have is: add_action( ‘admin_init’, ‘redirect_so_15396771’ ); function redirect_so_15396771() { if ( defined( ‘DOING_AJAX’ ) && DOING_AJAX ) … Read more

Is_search not working on search results page

I have an extra submenu with this code in the sidebar: if(is_404() || is_search()) : echo ‘should be empty’; else : if($post->post_parent == ’68’) $children = wp_list_pages(“title_li=&child_of=”.$post->post_parent.”&echo=0″); else $children = wp_list_pages(“title_li=&child_of=”.$post->ID.”&echo=0″); if ($children) { ?><ul><?php echo $children; ?></ul><?php } endif; I have a problem with the first line. It’s working fine on the 404 page … Read more

Multiple Conditions for Child Page Title

I’ve been trying to work with Conditional Tags and cannot wrap my head around this problem. PHP novice here. On sub-pages I need to display the parent page title as well as the page title. I have it working with this: <h1><?php echo get_the_title($post->post_parent);?></h1> <h2><?php the_title(); ?></h2> But the problem I have now is that … Read more