• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Customise content (featured posts)

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › Design Tips and Tricks › Customise content (featured posts)

This topic is: resolved

Tagged: featured post

  • This topic has 11 replies, 2 voices, and was last updated 4 years, 9 months ago by Brad Dalton.
Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • April 25, 2018 at 8:59 pm #219286
    LanceHillier
    Participant

    Hi all,

    I'm having a hard time trying to figure out how to customise what content is shown using the featured posts plug in.

    Problem: I have added custom styles to the editor, and as part of the posts I have 'by authorname' under the title, I want to remove this from the content preview in featured posts.

    I have tried using 'show excerpt'(and writing my own) which works fine but it removes the 'read more' text and I would like to keep this the way it is..

    I have tried adding a class to the 'by authername', but the featured post plug in just seems to grab the selected number of characters and wraps it in a <p>..</p> tag so I have had no luck with that.

    Any help would be greatly appreciated!!

    Lance.

    April 26, 2018 at 2:53 pm #219303
    Brad Dalton
    Participant

    Genesis Featured posts widget is native to Genesis not a plugin. Is this what you're referring to?

    What do you mean by content preview? Do you mean content limit or excerpts?


    Get Help – Book Consultation.

    April 26, 2018 at 3:55 pm #219317
    LanceHillier
    Participant

    Yep sorry should have said the featured content widget, yes the content limit, and the excerpts. I'm trying to remove the first couple of words, it's the Authors name which I put in the editor. I can do it by using the excerpt option but then the read more button is removed( I would like to keep this the way it is) and the content/content limit just grabs everything from the start.

    April 26, 2018 at 4:01 pm #219321
    Brad Dalton
    Participant

    This code might help


    Get Help – Book Consultation.

    April 26, 2018 at 5:21 pm #219325
    LanceHillier
    Participant

    Thanks Brad,

    As soon as I change the featured post widget to show excerpt it removes the 'read more..', by the looks of this code its supposed to add this link back in but it doesn't seem to want to do that for me.

    I have just tried your code, and the one I found on wordpress.org.

    I also the genesis theme settings to display 'entry excerpts' as per your post with no luck.

    not sure, will keep playing!!

    April 26, 2018 at 5:35 pm #219326
    LanceHillier
    Participant

    Just to add to this, I am adding my own excerpt from the editor screen

    April 26, 2018 at 5:48 pm #219328
    LanceHillier
    Participant

    I have this code that works...

    // Changes the behaviour of manual excerpts to include read more link
    function all_excerpts_get_more_link($post_excerpt) {
    return $post_excerpt . ' ... ID) . '">Read more';
    }
    add_filter('wp_trim_excerpt', 'all_excerpts_get_more_link');

    But throws this error...

    Notice: Undefined variable: post in /Volumes/Design/Website_Design_Jobs/CURRENT JOBS/LOCAL SERVER/writeabetterlife2/wp-content/themes/magazine-pro/functions.php on line 207

    Notice: Trying to get property 'ID' of non-object in /Volumes/Design/Website_Design_Jobs/CURRENT JOBS/LOCAL SERVER/writeabetterlife2/wp-content/themes/magazine-pro/functions.php on line 207
    Recently I’ve been thinking a lot about what holds us back and the things that prevent us from reaching our goals or taking the risks to move our lives forward. I have been guilty of holding myself back many times, so here are my thoughts and what I’ve lea … Read more

    April 26, 2018 at 5:57 pm #219329
    LanceHillier
    Participant

    Ok, this code works...

    function all_excerpts_get_more_link($post_excerpt) {
    global $post;

    return $post_excerpt . ' <p>' . __('read more') . '</p>';
    }

    add_filter('wp_trim_excerpt', 'all_excerpts_get_more_link');

    but places the 'read more' on a new line like so:

    Recently I’ve been thinking a lot about what holds us back and the things that prevent us from reaching our goals or taking the risks to move our lives forward. I have been guilty of holding myself back many times, so here are my thoughts and what I’ve lea

    read more

    I would like this on the end of excerpt like normal, I'm getting closer!

    April 26, 2018 at 6:31 pm #219330
    LanceHillier
    Participant

    Hi Brad,

    I found your code here Force a Read More Link on all Post Excerpts in WordPress

    Which is the best yet but it does put the 'read more' like so:

    Recently I’ve been thinking a lot about what holds us back and the things that prevent us from reaching our goals or taking the risks to move our lives forward. I have been guilty of holding myself back many times, so here are my thoughts and what I’ve lea

    read more

    Is there a way to place the 'read more' link onto the end of the excerpt??

    April 26, 2018 at 6:41 pm #219331
    LanceHillier
    Participant

    Ha,

    ok I have it working with code I used from this page..

    Thanks Brad, your post has helped me find the right solution, or a solution that works, really helps knowing what to look for.

    I wonder now if there is an easy way to omit words from being displayed in the featured post widget, from within the editor?? as that may be an easier solution for me to remove the Author name from the top of the post?

    Thanks again,
    Lance.

    April 26, 2018 at 7:59 pm #219332
    LanceHillier
    Participant

    All good,

    thanks Brad! and for anyone else reading my 'thinking out loud' posts!!

    Will mark this as solved.

    Lance.

    April 27, 2018 at 2:14 am #219336
    Brad Dalton
    Participant

    You could hook the author name in using PHP code rather than adding it to the editor.


    Get Help – Book Consultation.

  • Author
    Posts
Viewing 12 posts - 1 through 12 (of 12 total)
  • The topic ‘Customise content (featured posts)’ is closed to new replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2023 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble