Topic: Excerpts on specific pages only | WP Masonry Layout

Excerpts on specific pages only

Home Forums Lite Version Excerpts on specific pages only

This topic contains 6 replies, has 2 voices, and was last updated by  Masonry Guy 1 year, 9 months ago.

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #6695 Reply

    Kyle Anthony

    I 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?

    #6708 Reply

    Masonry Guy
    Keymaster

    Hi Kyle,

    Can you let me know how you have removed the excerpt currently ?

    Thanks

    #6710 Reply

    Kyle Anthony

    To 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.

    #6712 Reply

    Kyle Anthony

    I 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(); ?> –>

    #6713 Reply

    Masonry Guy
    Keymaster

    Hi Kyle,

    Please don’t do that. Please go through this thread. You will have idea of it.

    http://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

    #6715 Reply

    Kyle Anthony

    I am sorry, I am not understanding what I need to add.

    #6740 Reply

    Masonry Guy
    Keymaster

    Hi 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

Viewing 7 posts - 1 through 7 (of 7 total)
Reply To: Excerpts on specific pages only
Your information: