Comments (9)
Is there a PHP-snippet to do this in the meantime (until hopefully, one day Astra implements this)?
from astra.
Update: Do not use this script, it does not look good on mobile.
I got this back from support just now:
There is no such option is available to show the category description on the shop page.
You can add following code snippet to your child theme's functions.php file to add Category Description to the shop page.
We are going to release the theme update today itself after updating the theme the following code snippet doesn't require any style. As of now if you add this code snippet then you might need to style this description as per your requirement.
add_action( 'wp', 'single_product_variable_loggedin_user' );
function single_product_variable_loggedin_user() {
add_action( 'woocommerce_after_subcategory', 'astra_product_archive_description' );
}
/**
* Show Category Description on shop page
*
* @param object $category Category object
*/
function astra_product_archive_description( $category ){
$cat_id=$category->term_id;
$prod_term = get_term($cat_id,'product_cat');
$description = $prod_term->description;
echo '<div class="ast-woo-shop-product-description"><p>'.$description.'</p></div>';
}
Not sure if I'm reading this correctly, but it seems this is coming to the theme today by default.
from astra.
In the upcoming update we will be fixing the CSS bug that is making the category/subcategory title go below the description in your case - https://cl.ly/pPiD
You will still have to add this php snippet to display this description though.
from astra.
Thank you for your reply @Nikschavan. Just curious, why not included this in Astra Core? It seems like such an obvious feature to include.
Cheers
from astra.
My current thoughts are -
- Since this has been off from the initial design, Turning it on automatically in an update is a backward compatibility breakage. People using categories on their sites with current layout will automatically start seeing the descriptions in their completed websites.
- This should come as an option which will be by default off, but right now there does not seem to be other settings specifically for the archives.
I have added this to our list to consider the best approach for this.
from astra.
Ok, thank you @Nikschavan I'll wait for the update before proceeding.
from astra.
Astra Pro v1.2.0 did update fix this CSS breakage when the description is added using the filter so you can use this filter on your site.
We do have few more improvements to the category display on the shop page which will provide more style options in future updates of Astra Pro.
from astra.
Thank you @Nikschavan I've just tried it out and it works now. Cheers.
from astra.
@Nikschavan It works great on our corporate site too (ignore the design, still working on it)
One question though: For products, there is this awesome shadow hover effect. But not for categories? How do I get them the same (for consistency).
Cheers
Ps. no hurry, it's not a bug, just weird.
from astra.
Related Issues (20)
- PHP 8.2 Compatibility Issue - Site Crash HOT 7
- Use asynchronous HTTP calls to test cron
- Sale notification bubble goes outside of container box HOT 2
- CSS mismatch in submenu with rounded corners and separators HOT 1
- Dynamic secondary menu depending on primary menu or page HOT 1
- 🐞 Astra mobile product filters not working anymore
- Load Google Fonts Locally works only for a single domain HOT 3
- The eye icon that toggles visibility of title not showing in block editor in v4.1.8 with Spectra HOT 1
- Bug: dots before menu items in Astra 4.3.0 HOT 1
- Some strings in the welcome.js file are not formatted correctly for translation HOT 1
- The status string in AstraIntegration.js is not formatted correctly for translation HOT 1
- The status string in UsefulPlugins.js is not formatted correctly for translation HOT 1
- The title string in row-component.js is not formatted correctly for translation HOT 1
- Desktop menu is quickly displayed during mobile browsing HOT 2
- Smooth Scroll Fails to Move Keyboard Focus and Breaks Accessibility HOT 3
- Some strings in astra.pot are not available on translate.wordpress.org HOT 3
- Astra Pro reading/writing dynamic CSS even with file generation disabled
- Parameter value wrong HOT 3
- Gutenberg Editor extremely slow in Safari after updating to Astra 4.4.0
- Please rebuild the admin/assets/build/dashboard-app.js file with the latest changes HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from astra.