-
jeanzahn
https://wordpress.org/plugins/web-stories/ by default creates a stories archive page /web-stories
On that archive page, you can find featured images/cover pages, title and embedded stories (story slides) just to name a few.
I was wondering how to remove (not just hide with css) those embedded stories. The other user raised a similar question here https://generatepress.com/forums/topic/web-stories-archives/ and I applied the code provided by David, but unfortunately it didn’t work.
Any help would be greatly appreciated!
-
David
Hi there,
apologies for the late reply – your topic slipped through out system.
Can you share link to your site where i can see the WebStories ?
-
jeanzahn
Hi David, thank you for your reply. I sent you a private message in the Private information box. Please let me know if you have any questions.
-
Fernando
Hi Jeanzahn,
To clarify, do you want to remove the story functionality or the actual Stories from the archive page? Can you explain a bit more and provide an example of the scenario you want to achieve?
-
jeanzahn
Hi fernandoazarcon2, thank you for reaching out. I just wanted to disable these excerpts (if I understand it correctly) and keep the stories archive page in the same layout as it of my category page: users click on the covered images or titles to see the stories just like users click on featured images or titles to see the posts on a typical category page.
If using css, it only hides them. Therefore, I prefer a php solution to disable them for the sake of the size of loading page.
Please let me know if you still have any questions and thank you for looking into this for me or other GP customers.
-
Fernando
I see. How did you add this snippet?:
add_filter( 'excerpt_length', function($length){ if ( 'web-story' === get_post_type() ) { return 0; } return $length; }, 1000);
-
jeanzahn
Hi fernandoazarcon2, I tried this piece of code found on https://generatepress.com/forums/topic/web-stories-archives/ already but it didn’t work. That was why reached out.
-
Fernando
For clarity, did you add that code through functions.php on a Child theme or a plugin like Code Snippets?
-
jeanzahn
Hi fernandoazarcon2, I used the plugin Code Snippets to add the code.
-
Fernando
Can you try something like this instead?:
add_filter( 'excerpt_length', function($length){ if ( is_post_type_archive( 'web-story' ) ) { return 0; } return $length; }, 1000);
Let us know how it goes
-
jeanzahn
Hi fernandoazarcon2, thank you but unfortunately, they still remain.
My site is fairly new with little to none customization, but if you need me to set up a testing site, I can try to get you one.
-
jeanzahn
Also I wanted to point it out that I tested the stories archive page on a fresh server with WP’s default twenty twenty three theme installed, those story autoplays ain’t there.
-
Fernando
I see. Just for testing, if you set the excerpt count to 0 in Appearance > Customize > Layout > Blog, does it make the story disappear?
-
jeanzahn
Hi fernandoazarcon2, I did that already before I reached out. I thought it would remove those autoplays (that I thought were excerpts) too…
In addition, I even tried what @Ying suggested in this thread https://generatepress.com/forums/topic/remove-excerpt-entry-summary-on-cpt-archive-page/ , although I’m not sure if it is relevant…
The bottom line is I tried everything before I reached out.
-
David
Do you use the Block Editor ?
If so you could design your own archive content templates using a block element.Let me know
-
jeanzahn
Hi @David, could you please provide me an instruction to achieve the web stories archive page using a block element? I don’t need a fancy design but something that is consistent with my category archive pages (you can find in the private information area).
Thank you
- You must be logged in to reply to this topic.