adeel1973
Forum Replies Created
Viewing 2 replies - 1 through 2 (of 2 total)
-
Forum: Fixing WordPress
In reply to: I can’t expand a banner from left to rightHi @chandra9000
Welcome to WordPress! Don’t worry, this is a common issue, and you are already very close to the solution.
In WordPress, images often don’t stretch full-width because of the theme container or block settings that limit their size. Here’s how you can fix it:
Option 1- Using the Block Editor (Gutenberg)
1-Edit the page or post.
2-Click on your image block.
3-In the right sidebar, look for the “Width” option-set it to Full width or Wide width.
3-Update the page and check the result.
Option 2- With Custom CSS
If your theme doesn’t allow full width, try adding this CSS:
img.banner {
width: 100%;
height: auto;
object-fit: fill;
display: block;
}
Then, give your image the class banner.
Option 3- Check the Container
Sometimes the image is inside a <div> that has a max-width (like 1200px). You can remove that limit by adding this CSS:
.site-header img {
width: 100%;
}
Once you do this, your image should expand and resize with the browser window- just like in your HTML example.
I hope these options will help you
Best Regards
A.Ahmad, Italy
Chief Developer at
https://nettocalcolostipendio.it/Forum: Fixing WordPress
In reply to: hide blog category on blog pageHi @alemantico,
I faced the same issue before (also using Blocksy Pro with a child theme), and here’s a simple method that worked perfectly for me. I think that there is no need to touch PHP templates directly.
First Option - Use a Code Snippet Plugin
1-Install and activate the Code Snippets plugin (free from the WordPress plugin directory).
2-Go to Snippets → Add New and paste this code.
function exclude_category_from_blog($query) {
if ($query->is_home() && $query->is_main_query()) {
// Replace 12 with your Category B ID
$query->set('cat', '-12');
}
}
add_action('pre_get_posts', 'exclude_category_from_blog');
Replace 12 with the actual ID of your “Category B.”
To find it: Go to Posts → Categories, hover over your category name, and check the URL, it should look like tag_ID=12.
Save and activate the snippet. Done!
Now your blog page will show only posts from Category A, and Category B will stay hidden (but still available elsewhere, like your timeline page).
Second Option 2- Use a Plugin (No Code)
If you really don’t want to add code, install the free plugin “Ultimate Category Excluder”.
Go to Settings → Category Excluder
Check the category you want to hide from the Blog page and save.
It does exactly the same thing, just via an easy UI.
I have used both methods and the first one is cleaner and works great with Blocksy child themes.
Hope this helps you,
Best Regards
A. Ahmad , Italy
Viewing 2 replies - 1 through 2 (of 2 total)