Community Forums › Forums › Archived Forums › General Discussion › Drop Cap Issue
Tagged: drop cap, genesis, Magazine Pro
- This topic has 3 replies, 2 voices, and was last updated 11 years, 11 months ago by
nutsandbolts.
-
AuthorPosts
-
February 6, 2014 at 7:48 pm #89045
amandaotaylor
MemberHey I am trying to use drop cap shortcode in my posts. I can see them fine in my post view but on my home page it is removing the first letter of each sentence go away. How do I fix this. I am using the Magazine Pro theme.
http://www.joannfore.com/February 6, 2014 at 10:23 pm #89071nutsandbolts
MemberAre there any posts live on the site using the shortcode? Without seeing it, it will be difficult to find the cause of the problem.
Andrea Whitmer, Owner/Developer, Nuts and Bolts Media
I provide development and training services for designers • Find me on Twitter and Google+February 6, 2014 at 10:45 pm #89079amandaotaylor
MemberYes its the first post on the recent blogs page. The one titled "Share Your Voice to Make a Difference". I added it back in for you to take a look.
February 6, 2014 at 10:53 pm #89083nutsandbolts
MemberOkay, the issue is that WordPress excerpts strip out all formatting (dropcaps, bold, italics, etc.) - so it's showing on the single post, but not the homepage. There are a couple of ways you can remedy that.
(1) You can set the site to show full posts and have her use the more tag within the post editor to truncate posts manually.
(2) I have a function that will truncate each post after a certain number of paragraphs. In this case, it will add the read more tag after the third paragraph. You can add this to functions.php (and then go to Genesis > Theme Settings and tell it to show full posts - the function will override it):
//* Add read more link after third paragraph function nabm_get_the_content_first_three_paragraphs() { $content = get_the_content(); $content = apply_filters('the_content', $content); $content_explode = explode("</p>", $content); $c = 0; $p = count($content_explode); $return_data = ""; // Pictures will be caught in this for the most part due to auto paragraphing in WP. while($c < 3) { $return_data = $return_data . $content_explode[$c] . "</p>\n"; $c++; } return $return_data; } function nabm_archive_content_logic() { if ( is_category() || is_archive() || is_home() ) { remove_action( 'genesis_entry_content', 'genesis_do_post_content' ); add_action( 'genesis_entry_content', 'nabm_archive_content' ); } } add_action( 'get_header', 'nabm_archive_content_logic' ); function nabm_archive_content() { echo nabm_get_the_content_first_three_paragraphs(); echo '<div class="morelink"><a href="' . get_permalink() . '">Continue Reading...</a></div>'; }
Andrea Whitmer, Owner/Developer, Nuts and Bolts Media
I provide development and training services for designers • Find me on Twitter and Google+ -
AuthorPosts
- The forum ‘General Discussion’ is closed to new topics and replies.