Jump to content

Archived

This topic is now archived and is closed to further replies.

williamweber

DMS2 Show Full Post Text

Recommended Posts

williamweber

I've got the setting checked in the WP Admin -> Reading section to show full text but my main page still shows only excerpts. Is is possible to have the new DMS2 WP Content/Loop show full text without reverting to Legacy Mode?

Share this post


Link to post
Share on other sites
williamweber

Does anyone know if this is possible? I'd like to have full posts on my front page not just excerpts.

Share this post


Link to post
Share on other sites
williamweber

Thanks batman. I did a bit of reading but I'm still not sure what to do with that.

Share this post


Link to post
Share on other sites
batman

Hi again

You can add to your "Child theme" on the "function php" something like

 

function custom_excerpt_length( $length ) {
return 2000;
}
add_filter( 'excerpt_length', 'custom_excerpt_length', 999 );
 
to change the length except, yo change the "return 2000" as you like

Life is too short to remove USB safely ...

Share this post


Link to post
Share on other sites
jasonthedce

Any chance there is a fix coming that will prevent DMS2 from overriding the settings in Wordpress to show the full posts on the blog feed? I tried the fix that batman recommends above to get all the content to show, but it loses all formatting since it's an excerpt.

Share this post


Link to post
Share on other sites
Simon

Easy, this is what filters were designed for:

 

https://gist.github.com/Pross/87b066f0493ce10cd77c

Share this post


Link to post
Share on other sites
jasonthedce

Simon_P

 

That almost does the trick. Thanks for that! A few minor issues if you have time:

  1. The blog now shows the full post (http://firsttrinity.com/blog/), but there is still a "Read More" link and the formatting is not quite right (compare to http://firsttrinity.com/2014/06/can-we-trust-the-bible/). Line breaks appear to not be showing correctly.
  2. How would you modify this to include the same functionality on a tag page? See http://firsttrinity.com/tag/faq-2014-sermons/

Share this post


Link to post
Share on other sites
Simon

You'd have to remove the readmore with CSS

 

if( $wp_query->is_home || $wp_query->is_tag )

Share this post


Link to post
Share on other sites
jasonthedce

Thanks again!

 

I was able to get the formatting to copy correctly using this page:

 

http://www.web-templates.nu/2008/08/31/get_the_content-with-formatting/

 

For quick reference, the code you need is:

function get_the_content_with_formatting ($more_link_text = '(more...)', $stripteaser = 0, $more_file = '') {
	$content = get_the_content($more_link_text, $stripteaser, $more_file);
	$content = apply_filters('the_content', $content);
	$content = str_replace(']]>', ']]>', $content);
	return $content;
}

Share this post


Link to post
Share on other sites

  • Similar Content

    • Lisa Haran
      By Lisa Haran+
      Hi 
      I have a map here http://www.iloveoffset.com/maps/
      I want to add several pointer locations to the map, but when I do they do not appear.
      On this map there are 2 pointer locations and as you can there is only one visible.
      Earlier today I added 7 and could only see 4 so there is something odd going on.
      My theme is up to date
    • clj182
      By clj182+
      Hello,
      I've been having trouble unlocking the template section for past couple of weeks. When I try clicking nothing happens. 
      I've deleted my custom css and removed plugins. Im down to having only the following plugins:
      Akismet
      Contact Form 7
      DMS Professional Tools
      Pagelines Updater
      WooCommerce
      It was working fine before i have no idea what's going on with it.
    • flourishdesignstudio
      By flourishdesignstudio+
      My DMS 2 site http://www.heart-stone.com/ will not save any new custom css... I can still edit templates and publish those but any custom css that I enter never saves.
      All WP files, themes, and plugins are up to date. 
      Any thought about what might be causing this?
    • flourishdesignstudio
      By flourishdesignstudio+
      Is there a way to edit the custom CSS via FTP? I know I can edit the custom code in the Chrome editor but is there a file path I can use to find and edit the CSS directly from our FTP?
      Thanks in advance for the help!
    • nizami
      By nizami+
      Using navbar section with correctly configured WP menu to display main navigation at https://elenaangel.com. 
      All fine in desktop viewport. Menu displays twice in hamburger mode. How to fix this please? 

×