Home › Forums › Lite Version › Excerpts on specific pages only
- This topic has 6 replies, 2 voices, and was last updated 5 years, 5 months ago by
Masonry Guy.
- AuthorPosts
Kyle Anthony
GuestI customized the plug in to not show excerpts, but I want to show on specific pages now. Is their a way I can customize the plugin to show excerpts on specific pages only?
Masonry Guy
KeymasterHi Kyle,
Can you let me know how you have removed the excerpt currently ?
Thanks
Kyle Anthony
GuestTo be honest, I dont remember exactly. I went in and erased the code it in the editor. I can always reinstall it if there is way to change the code instead of erase it.
Kyle Anthony
GuestI edited the wp-masonry-layout/themes/default/layout.php file. I did not delete, but i did edit and note what i made inactive. See below
<!– THIS IS FOR EXCERPTS <div class=”wmle_post_excerpt”>
<?php the_excerpt(); ?> –>Masonry Guy
KeymasterHi Kyle,
Please don’t do that. Please go through this thread. You will have idea of it.
https://www.masonrylayout.com/forums/topic/removing-from-posts-without-content/. There it is used if (is_tag()) { but in place of that you need to use if (is_page(‘YOUR_PAGE_SLUG_HERE’)) { for your page wise condition.
Thanks
Kyle Anthony
GuestI am sorry, I am not understanding what I need to add.
Masonry Guy
KeymasterHi Kyle,
You need to keep this in your functions.php file.
add_filter('excerpt_length', 'my_excerpt_length'); function my_excerpt_length($length) { if (is_page('YOUR_PAGE_SLUG_HERE')) { return 100; // Show excerpt } else { return 0; // Don't show excerpt } }
Thanks
- AuthorPosts