Jump to content


Photo
- - - - -

Excerpts- Spacing and/or Customization (WHP)


  • Please log in to reply
9 replies to this topic

#1 nrbeatty

nrbeatty

    Advanced Member

  • Members
  • PipPipPip
  • 99 posts

Posted 28 June 2011 - 02:38 AM

Hi guys, On my posts/blog page, the excerpts are just a run-on of text:

Please Login or Register to see this Hidden Content

How can I get the excerpts to either 1) maintain the spacing of the actual post text, OR 2) customize the post excerpt. Thanks, Nick

#2 catrina

catrina

    Advocate

  • Members
  • 12345 posts
  • LocationCalifornia
  • Country: Country Flag

Posted 28 June 2011 - 02:51 AM

I don't see any run-on text. It looks fine to me. Which browser are you viewing the site on? (I'm viewing on the latest Firefox for Mac)

#3 nrbeatty

nrbeatty

    Advanced Member

  • Members
  • PipPipPip
  • 99 posts

Posted 28 June 2011 - 02:58 AM

I'm using the latest FF and Safari. Check out screenshots: The top image is the single-post page, with proper spacing. The second image is from the blog/posts page. Do you see how the excerpt loses all spacing? 1) Does the excerpt understand hard line-spacing? 2) What about custom excerpts for WHP?

#4 timlinson

timlinson

    Advocate

  • Members
  • PipPipPipPipPip
  • 1032 posts

Posted 28 June 2011 - 03:05 AM

Wordpress strips the formatting from excerpts. There are probably excerpt plugins for more customized excerpts, or you could try

Please Login or Register to see this Hidden Content

.

#5 nrbeatty

nrbeatty

    Advanced Member

  • Members
  • PipPipPip
  • 99 posts

Posted 28 June 2011 - 03:08 AM

Thanks Tim. I'll check out plug-ins. I thought customizing excerpts was old news- why do I recall lots of themes having a box or short-code for that, and maybe I'm wrong, but I thought wordpress even supported custom excerpts. Am I crazy?

#6 Kate

Kate

    Advocate

  • Members
  • 3039 posts

Posted 28 June 2011 - 12:41 PM

Hey Nick, You can use the "Custom Excerpt" box underneath the post edit screen. If you don't want to do that each time, then you would modify the post loop file, perhaps adding code for a plugin like "The Advanced Excerpt". (The line of code used for the plugin would basically take the place of the current code.)

#7 nrbeatty

nrbeatty

    Advanced Member

  • Members
  • PipPipPip
  • 99 posts

Posted 29 June 2011 - 02:26 AM

I see now- the "Excerpt" field was switched off by default in WP 3.1.

When using custom excerpt, I need to add the "Read More" code to the functions.php file, so I don't have to add the one-line of code to each custom excerpt. How can I add it to the custom code box for WhiteHousePro? Here is the code that should go in functions.php file; I want to put in the the custom code box- what do I need to add to get that to work from the custom code box?

Please Login or Register to see this Hidden Content


Thanks!

Nick

#8 catrina

catrina

    Advocate

  • Members
  • 12345 posts
  • LocationCalifornia
  • Country: Country Flag

Posted 29 June 2011 - 02:53 AM

The Custom Code CSS rules box can only have CSS. It can't have PHP inside it. WhiteHousePro also has a functions.php file...

#9 nrbeatty

nrbeatty

    Advanced Member

  • Members
  • PipPipPip
  • 99 posts

Posted 29 June 2011 - 09:44 AM

Thanks for the clarification. I was just trying not to edit edit files that might be reset with theme updates.

I added the code above to the functions.php file. It "kills" the website and the broswer displays:

Parse error: syntax error, unexpected '"' in /home/aocpmr/public_html/wp-content/themes/whitehousepro/functions.php on line 20


Line 20 refers to the last line of code...

Any thoughts? The code is from wordpress.org and should be correct..

#10 Kate

Kate

    Advocate

  • Members
  • 3039 posts

Posted 29 June 2011 - 11:59 AM

Hi Nick, It's a syntax error in your code, on this line: `return $output . 'ID) . '"> Read More...';` Before we help you out with that, have you checked out this page:

Please Login or Register to see this Hidden Content

From a quick glance at your code, it appears you're missing a bit ;)