Excerpts to Home Page – Executive Theme

Community Forums Forums Design Tips and Tricks Excerpts to Home Page – Executive Theme

This topic is: not resolved

This topic contains 3 replies, has 3 voices, and was last updated by  paultp 10 months, 1 week ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #31691

    Vinnie
    Participant
    Post count: 4

    I am using the Executive Theme to create a website for a customer.  On the home page of the Executive theme it allows for a snippet to be placed under each featured image on the page. However, it doesn’t work so well as it draws its content from the first line of the featured pages content, rather than let you customise what that content should be.
    My question is, how do I get to customise that content and maybe draw it from the excerpt?
    I have installed a page excerpt plugin that draws the content that works with pages. It works well for the slider and draws the custom excerpt into the slide.  Is there way of pushing the page excerpt to the home page featured page content?
    Thanks
    Vincent

    #31758

    Megan Gray
    Participant
    Post count: 23

    Hi Vinnie,

     

    Try downloading this plugin: http://wordpress.org/extend/plugins/genesis-featured-widget-amplified/. If you already have a plugin to add manual excerpts to pages, this featured page widget will allow you to select the manual excerpt rather than just the content limit.

     

    You could also just add this code to your functions.php file, and note that this is also where you’d control the “Read More” type text.

     

    function custom_excerpt($text) { // custom ‘read more’ link
    if (strpos($text, ‘[...]‘)) {
    $excerpt = strip_tags(str_replace(‘[...]‘, ‘… <a href=”‘.get_permalink().’”>read more…</a>’, $text), “<a>”);
    } else {
    $excerpt = ‘<p>’ . $text . ‘<br/><a href=”‘.get_permalink().’”>Read more…</a></p>’;
    }
    return $excerpt;
    }
    add_filter(‘the_excerpt’, ‘custom_excerpt’);
    ?>

     

    Megan

    #31785

    Vinnie
    Participant
    Post count: 4

    Brilliant Megan and thank you that helped indeed!
    I should add though that both ways broke the system and left me with a white screen. However, the idea of the Genesis plugin prompted me to search for another plugin and I eventually opted for the Image widget here: http://wordpress.org/extend/plugins/image-widget/ that worked with a custom snippet on the home page.
    Vincent

    #45058

    paultp
    Participant
    Post count: 5

    Hi,

    For anyone else wanting to do this, I achieved it as follows:

    1. Install the http://wordpress.org/plugins/page-excerpt/ to give you an excerpt box on pages (like the one on posts). You can then put what you like in the custom excerpt.

    2. Install the http://wordpress.org/extend/plugins/genesis-featured-widget-amplified/ plugin and use it to feature your page.

    3. Add the following code  to your functions.php to get a read more link (change the read more text to whatever you want). Because the read more link in the amplified plugin only shows up if you select “show content limit”.

    /** add a read more link to an excerpt **/
    function custom_excerpt($text) {  // custom ‘read more’ link
    if (strpos($text, ‘[...]‘)) {
    $excerpt = strip_tags(str_replace(‘[...]‘, ‘… <a href=”‘.get_permalink().’”>[Read More...]</a>’, $text), “<a>”);
    } else {
    $excerpt = ‘<p>’ . $text . ‘<br/><a href=”‘.get_permalink().’”>read more…</a></p>’;
    }
    return $excerpt;
    }
    add_filter(‘the_excerpt’, ‘custom_excerpt’);

    Hope that helps

    • This reply was modified 10 months, 1 week ago by  paultp.
    • This reply was modified 10 months, 1 week ago by  paultp.
Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.