Featured page widget text length

Featured page widget can be used in multiple ProteusThemes themes: BuildPress, MentalPress, CargoPress and LegalPress. In each theme the widget has a slightly different design, but it always has the text block.

To change the Featured page widget text length you will have to change some code in the theme. Let's take a look at how to change the length of the text in each theme.

BuildPress

Edit the file: /inc/widgets/widget-featured-page.php and find these two lines and change the values to your liking: 

const INLINE_EXCERPT = 60;
const BLOCK_EXCERPT = 240;

 

MentalPress

In this theme you will have to edit the numbers in the ProteusWidgets plugin. Edit the file: /wp-content/plugins/proteuswidgets/widget-featured-page.php and change these values to your liking: 

const INLINE_EXCERPT = 60;
const BLOCK_EXCERPT = 240;

 

CargoPress, LegalPress, RepairPress, StructurePress and all newer themes

Paste this code at the end of your functions.php file and change the lengths to your liking:

add_filter( 'pw/featured_page_excerpt_lengths' , 'custom_featured_page_widget_excerpt_lengths');
function custom_featured_page_widget_excerpt_lengths( $excerpt_lengths ) {
  $excerpt_lengths['inline_excerpt'] = 60;
  $excerpt_lengths['block_excerpt'] = 240;
  return $excerpt_lengths;
}

 

Note: when you update the theme, these changes will get overwritten.


Have more questions? Submit a request

Can't find what you're looking for?

Submit a ticket to our help team or Start a new community discussion.

Comments

  • Avatar
    mouhssine ettaouti

    how about in Dining Restaurant theme ?

  • Avatar
    Gregor Capuder

    The Dining Restaurant does not have a Featured page widget.

    If you need some help with this theme, please open a new support ticket or create a post in the forum.

  • Avatar
    Cody

    The recommendation for Repair Press above didn't work for me. I'm also hoping to change the title text color of the widget and changing CSS values isn't working either...

  • Avatar
    Gregor Capuder

    Hi,

    I just tested this on my demo site and it works ok. If you have a fixed length Excerpt text set for the page that is featured in the Featured Page widget, then that could be the problem (the text will not change).

    For the CSS changes, you probably just have to use the right selectors... Please open a forum support ticket, if you need anything else.

  • Avatar
    Cody
  • Avatar
    Taitus Mechedam

    I would like to change featured page length to zero.

    I changed it in functions.php file

    how can I upload it

  • Avatar
    Gregor Capuder

    You can upload the edited functions.php file to your server via FTP, to the folder: `wp-content/themes/your_theme_name/`

Can't find what you're looking for?

Submit a ticket to our help team or Start a new community discussion.
Powered by Zendesk