Image Gallery photos aren’t cropping, even though they’re set to crop

Can someone help???

I know I’m uploading relatively high-res photos, and yet they’re still not filling the frames of the image gallery I’m creating in the post.

I’ve set the switch to “Crop” in the gallery setting, and still when I preview on the front end, they’re not filling the frames.

Is there a code or site-wide solution to this? I’m managing so many posts and it’s such a hassle to have to go into “image editor” and tweak individual photos when possible.

Thanks.

Problem with two WP installation on root and subfolder

Let me give you some context.I have a website.com and website.com/blog with each their own wordpress instal

I created the the blog in the first place, and then the “main” wordpress.

The weird thing is that now, when I want to go to website.com, it automatically redirects me to website.com/blog.

And sometimes it is the opposite, the website works, but the /blog is not existing anymore… (404 or just blank page) And these two cases are shifting from one to another (not sure how)

Any idea why this happens ?

Thanks for your help !

Genesis Child Theme – Customize body

So I created a custom post type and I’ve also created a custom page called page-profile.php that follows the WordPress templating.

Here is the code inside page-profile.php:

<?php  $  args = array(     'post_type' => 'profile', // enter custom post type     'orderby' => 'title',     'order' => 'ASC',     'posts_per_page' => '4', ); $  loop = new WP_Query($  args);  get_header(); // displays header get_sidebar(); get_footer(); //displays footer 

So the header, footer and sidebar all are being called in.

How can I target the red box and create templating where I would like to show the title and thumbnail?

enter image description here

List just subcategory and products of active category page in Woocommerce

Working on a category page – taxonomy-product_cat.php – I want to list all the subcategories of that category page, with all its products. I would think it is simple enough but I cant get it to work.

I can list all categories of the shop with all subcategories and all products – So for example bags would list all products of the whole shop.

Or I can list the subcategories of just the category page – but without the products listed.

How can I list just the subcategories of the category page with their products?

The code I am using that works great, but loops all the categories in the shop, and not just the active category is:

$  args = array('taxonomy' => 'product_cat' ); $  all_categories = get_categories( $  args );  foreach ($  all_categories as $  cat) {     $  category_id = $  cat->term_id;     $  args2 = array('taxonomy' => $  taxonomy,'parent' => $  category_id,'hierarchical' => $  hierarchical, 'orderby' => $  orderby, 'order' => $  order,'hide_empty' => $  empty); $  categories = get_categories( $  args2 );   $  sub_cats = get_categories( $  args2 );             if($  sub_cats) {                 foreach($  sub_cats as $  sub_category) {                     echo "<h2>".$  sub_category->cat_name."</h2>";                      $  args = array( 'post_type' => 'product','product_cat' => $  sub_category->slug, 'orderby' => $  orderby, 'order' => $  order);                             $  loop = new WP_Query( $  args );                                while ( $  loop->have_posts() ) : $  loop->the_post(); global $  product; ?>                               <!--HTML HERE-->                               <?php endwhile;  wp_reset_query();  }}} ?> 

How to allow single quote with esc_html__() without sprintf()

Because of security reasons we are of course required to use esc_html__() for WP development. This is annoying because if you’d want to pass a single quote into your strings, you’d have to use sprintf() to make it work. Otherwise you just get &#039; printed out, instead of a '.

Without using sprintf():

esc_html__( 'Wasn\'t your favorite color red?', 'domain' ); // Output: Wasn&#039;t your favorite color red? esc_html__( 'Provided reason isn\'t selected', 'domain' ); // Output: Provided reason isn&#039;t selected 

With the use of sprintf() I can get single quotes to work (of course).

sprintf( esc_html__( 'Wasn%st your favorite color red?', 'domain' ), '\'' ); // Output: Wasn't your favorite color red? sprintf( esc_html__( 'Provided reason isn%st selected', 'domain' ), '\'' ); // Output: Provided reason isn't selected 

I’d like to know if there is a different way to achieve the same output. I am afraid there is none, but I thought why not give it a shot, who knows.

Twenty Twenty edit “Read more” text

I am using wordpress Twenty Twenty theme. So i am trying to change the “Read more” text after each blog and this is the function i am trying to do it with.

function modify_read_more_link() { return '<a class="more-link" href="' . get_permalink() . '">Your Read More Link Text</a>'; } add_filter( 'the_content_more_link', 'modify_read_more_link' ); 

I found this function (below) in functions.php, which i think is responsible for generating the “Read more” text?

function twentytwenty_read_more_tag( $  html ) { return preg_replace( '/<a(.*)>(.*)<\/a>/iU', sprintf( '<div class="read-more-button-wrap"><a$  1><span class="faux-button">$  2</span> <span class="screen-reader-text">"%1$  s"</span></a></div>', get_the_title( get_the_ID() ) ), $  html ); }  add_filter( 'the_content_more_link', 'twentytwenty_read_more_tag' ); 

I changed the first function add_filter to match the second one so now i have this code.

function modify_read_more_link() { return '<a class="more-link" href="' . get_permalink() . '">Your Read More Link Text</a>'; } add_filter( 'the_content_more_link', 'twentytwenty_read_more_tag' ); 

But the text isn’t changing and if i change the function “modify_read_more_link” to match the original function i get this error.

Cannot redeclare twentytwenty_read_more_tag() (previously declared in /home3/shroomy/public_html/wp-content/themes/twentytwenty/functions.php:572)

I don’t think i even need to change the functions name, but i am completely new to this.

What’s the correct way to add capabilites to user roles?

A third-party plugin adds the capability ‘edit_booked_appointments’. I’d like to assign this capability to the already existing user role ‘editor’. I created the following function in my child theme:

function add_booking_role_to_editor() {     $  role = get_role( 'editor' );      $  role->add_cap( 'edit_booked_appointments', true );  }  add_action( 'init', 'add_booking_role_to_editor'); 

As far as I understand the whole topic, user roles get written to the database so there is no need to hook this function into the ‘init’ action. What would be the correct way to do this? Is there a way to fire this once, after the corresponding plugin has been activated? I tried it with the action ‘plugins_loaded’ but that did not work at all.

WordPress Custom Post Status not Public but Viewable Through Link: Privately Published Posts

I have been working on my site to bring up private posts on my site. I built a custom post status for this purpose.

My goal is to exclude posts belonging to that post status from search, from Blog Page, from WordPress Queries, RSS Feed etc. Basically there should be no mentions of it anywhere on site.

Till here it seems simple, but the problem is that I WANT people to be able to view the post via direct link.

Basically I want it to be not mentioned throughout my site, but if someone visits it from direct link, they can view it.

function custom_post_status(){  register_post_status( 'privatised', array( 'label' => _x( 'Privately Published', array('post', 'download')), 'public' => false,  'exclude_from_search' => true, 'show_in_admin_all_list' => true,  'show_in_admin_status_list' => true,  'label_count' => _n_noop( 'Privately Published <span class="count">(%s)</span>', 'Aggregated <span class="count">(%s)</span>' ),  ) );  }  add_action( 'init', 'custom_post_status' );  

Here if you see in the Array, the first option is Public, and I set it to false, which basically ensures that my post is not there on my Blog Page, or search, or Taxonomy Page, or RSS FEED etc. Etc. But if I open the same post via it’s direct url, then it gives a 404, because not found…

Please help, me have my post visible only through the direct link of it.

As a sidenote, Is it possible that I can have it public, and then exclude it from Taxonomy and all, like I can do with exclude from search…

Change Image in Mobile Search Results

When searching my company, “Tattini Boots”, on a mobile device you will see that the following cut off image is displayed next to the search result (see image below). This is not the image that I have set in Yoast or the Featured Image for Search Results on my index page. Can someone dive into the source and allocate why this image is being chosen? This image is simply a slider overlay on the main page: www.TattiniBoots.com

enter image description here