Jump to content
Sign in to follow this  
cvandyck

Abbreviate Seen text of published story

Recommended Posts

cvandyck

How do you abbreviate the amount of text shown on the screen of a published story? ie... text is 20 lines long but only want to show 10 lines and then it preferably scrolls or perhaps you hit a "more text" button.

Share this post


Link to post
Share on other sites
Kate

Hi Chuck, Do you mean on a single post page? Or, on the blog page which lists all posts? If it's the latter, there's a few ways to change the excerpt. One of which is to use the

<!--more-->

tag, or to simply use the manual excerpt box. (located directly below the main edit screen of the post edit page).

Share this post


Link to post
Share on other sites
cvandyck

Single Post or Features page .. ie... stories not for comment which may be longer and run off screen... also, how do you vary the amount on the post page .. ie..mine shows one line then i have the "more" tag. how do i make it more lines .. say 10 vs 1 or 2

Share this post


Link to post
Share on other sites
cvandyck

example: http://vandyckfamily.me/?page_id=103 How do you abbreviate the amount of text shown on the screen of a published story? ie... text is 20 lines long but only want to show 10 lines and then it preferably scrolls or perhaps you hit a "more text" button. Single Post or Features page .. ie... stories not for comment which may be longer and run off screen... also, how do you vary the amount on the post page .. ie..mine shows one line then i have the "more" tag. how do i make it more lines .. say 10 vs 1 or 2

Share this post


Link to post
Share on other sites
catrina

That's something that can be adjusted in the functions.php file. Please see this documentation: http://codex.wordpress.org/Function_Reference/the_excerpt#Control_Excerpt_Length_using_Filters You can increase the number of words to increase the number of lines.


Please read the docs before posting. Please do not private message me unless I ask you to.

Designer | Catrina Dulay

Founder | Catrina and Mouse

Share this post


Link to post
Share on other sites
cvandyck

k, so we're getting closer! appended file with suggested code ... now how do I adjust filter so that it will adjust post length?

Share this post


Link to post
Share on other sites
kastelic

Looks like you need to adjust the number in

return 20;

Could you post the code you used here?

Share this post


Link to post
Share on other sites
cvandyck

function new_excerpt_length($length) {return 100;} add_filter('excerpt_length', 'new_excerpt_length'); Doesn't seem work. Ideas?

Share this post


Link to post
Share on other sites
catrina

You must add the code to the functions.php file, which you can access through Appearance > Editor in the Dashboard. The file is listed on the right side and it's called Theme Functions.


Please read the docs before posting. Please do not private message me unless I ask you to.

Designer | Catrina Dulay

Founder | Catrina and Mouse

Share this post


Link to post
Share on other sites
cvandyck

ok. so that worked nicely for the Post page... thank you ... how do I do this for the other pages .. ie.. highlight, default, feature?

Share this post


Link to post
Share on other sites
catrina

You'll have to use a different hook to place it on those pages. If you look at the list of hooks for the Highlight page, you can find the right one to use.


Please read the docs before posting. Please do not private message me unless I ask you to.

Designer | Catrina Dulay

Founder | Catrina and Mouse

Share this post


Link to post
Share on other sites
cvandyck

where are the hooks that i need to look for?

Share this post


Link to post
Share on other sites
kastelic

In PlatformPro Settings -> Template Setup click Advanced Setup on any section to see the list of associated hooks.

Share this post


Link to post
Share on other sites
cvandyck

Could you please explain what exactly that a hook is, and how to use it

Share this post


Link to post
Share on other sites
cvandyck

k, so I'm trying to figure this out, but I am clueless as what hook I should get (there are several) or the context that I should add it in. Could you please show me how to limit the number of lines in both the content sections and in the boxes

Share this post


Link to post
Share on other sites
cmunns

You are filtering the excerpt which only applies to the post page by default. So the function you've added will work for default posts, however custom post types e.g. boxes,features have custom output. THe boxes use this to display content `<?php echo do_shortcode($bpost->post_content); ?>` which means that filtering the_excerpt function won't work...but you really shouldn't need to have that much text in your boxes anyway it is manual input meant for a snippet in the first place that you can manually link out to other pages. In other words I'm not sure why/how you would need it for boxes.

Share this post


Link to post
Share on other sites
cvandyck

Adam.. thank you for your insight. I still have the issue though. Please go to http://vandyckfamily.me/?page_id=103 In this case, it is the default page with the main content. How do I abbreviate it.. I would appreciate it, if you would respond with specific code, so that I can then see how to do it for the other pages .. ie.. highlight, feature, etc.

Share this post


Link to post
Share on other sites
cmunns

well to actiave excerpts on pages you'd need this in your PBase functions.php file `add_post_type_support( 'page', 'excerpt' );` but it will only work with the actual content of the page not the whole body of each template where you have sections activated. Make sense?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

×