Paul Skip Brown
Forum Replies Created
-
I’m Googling for this right now. Did you ever find a solution Niska?
Forum: Plugins
In reply to: [Multi-column Tag Map] Responding to screen sizeThank you, understood. I’ll have a play around with CSS / Media queries I think.
Forum: Plugins
In reply to: [Multi-column Tag Map] Responding to screen sizeThat should be:
12
3
4Forum: Hacks
In reply to: RSS excerpt issue with FlipboardThank you bcworkz. I’ve added a snippet in to my functions.php because when I delved in to my version of WordPress I think the above code is outdated. This is what I added – does it look coded correctly (not withstanding that it may not work)?:
//include paragraphs in excerpts function skips_strip_all_tags($string, $remove_breaks = false) { $string = preg_replace( '@<(script|style)[^>]*?>.*?</\\1>@si', '', $string ); $string = strip_tags($string, '<p>'); if ( $remove_breaks ) $string = preg_replace('/[\r\n\t ]+/', ' ', $string); return trim( $string ); } remove_filter('wp_trim_words', 'wp_strip_all_tags'); add_filter('wp_trim_words', 'skips_strip_all_tags');
I got to this by looking at the core formatting.php file and tracing through how it seems to create the excerpt. It is exactly the same as the core file with the addition of the
<p>
tag to this line:$string = strip_tags($string, '<p>');
The reason I think this should in theory work is that when I see other excerpts on Flipboard it seems to respect paragraphs (or line breaks at least – paragraphs are unformatted) but mine just all merge together into a single block. The full post which is gathered from RSS appears to respect many html tags and is nicely formatted – is just the excerpt that’s a problem.
I can’t say whether it works because I’m not sure how to force Flipboard to re-cache the RSS feed now that it already has it. I find RSS confusing!
Forum: Hacks
In reply to: RSS excerpt issue with Flipboardfunction wp_trim_excerpt($text) { // Fakes an excerpt if needed global $post; if ( '' == $text ) { $text = get_the_content(''); $text = apply_filters('the_content', $text); $text = str_replace('\]\]\>', ']]>', $text); $text = strip_tags($text); $excerpt_length = 55; $words = explode(' ', $text, $excerpt_length + 1); if (count($words)> $excerpt_length) { array_pop($words); array_push($words, '[...]'); $text = implode(' ', $words); } } return $text; }
This is the code that generates the excerpt I think although it seems that excerpt length is ignored by Flipboard. Renaming it and adding it to functions.php with the following edit should do the trick:
$text = strip_tags($text, '<p>');
but I’m unsure how to target it at the single feed rather than excerpts in general. Found at https://aaronrussell.co.uk/legacy/improving-wordpress-the_excerpt/
Forum: Plugins
In reply to: [Autoptimize] css being included in custom rss feed breaks feedThanks Frank, yes that method is what I used pretty much second time. I’ll delete the files associated with the first link now. Many thanks.
Forum: Plugins
In reply to: [Autoptimize] css being included in custom rss feed breaks feedHi Frank, I’ve found another way to create a new RSS feed without needing to create the URL by creating a blank page – this seems to work better in that it doesn’t create the css issue – for now I’ll leave both up so you can see the difference. The better feed that works is at https://skipology.com/feed/flipskip/ . I’ll delete the feed above in due course but wanted to leave it a while for you to see. Cheers.
Forum: Fixing WordPress
In reply to: WordPress RSS Feed and FlipboardI’m not sure I have the answers but I ended up finding a tutorial and creating a bespoke RSS feed. Still can’t find any guidance about what to do re pubDate though if I update an article. I know posting date can be changed manually in the post editor but would just a small time change trigger an RSS update I wonder. I don’t think so but I can’t find a definitive answer.
Forum: Plugins
In reply to: [Autoptimize] Minifying JS and Jetpack Like ButtonHi Frank, apologies I thought I’d sent another comment last night but must have closed the browser before sending. I decided the WordPress Like Button (its a WordPress blog like button in the Jetpack plugin – not the social media sharing stuff) wasn’t worth it so I switched it off. Everything seems to be running fine.
Today’s project is W3 Total Cache for the stuff excluding minifying and linking in to a CDN. Wish me luck ??
Please regard this as resolved.
Forum: Plugins
In reply to: [Autoptimize] The basicsThank you Frank. That is really great guidance. I’ll try to pluck up the courage to try this out later today :). Thanks again.
Forum: Plugins
In reply to: [WordPress Popular Posts] Issue with non-breaking spaceWell unless something leaps out I think this can be ignored. I have manually edited my posts to remove the error. Seemed quickest way ??
Forum: Plugins
In reply to: [WordPress Popular Posts] Issue with non-breaking spaceI have discovered that if I replace
return $content;
withreturn htmlspecialchars($content);
in my function the plugin output appears to render fine. The problem is the rest of my site then displays all the
– its a bit like they are operating opposite each other. Can you help – I looked at the plugin code but couldn’t really see what might need adapting.Thank you Héctor.
Forum: Plugins
In reply to: [WordPress Popular Posts] Issue with non-breaking spaceTo clarify the array part hasn’t displayed properly it is…
'{ ' => '{&npsp;',
' }' => '&npsp;}'
Thank you.
Forum: Plugins
In reply to: [WordPress Popular Posts] Issue with non-breaking spaceI may have found the problem but I can’t understand why or what the solution is. In my functions.php I have the following…
// stop brackets in titles appearing on own line
function clean_orphan_titles($content){
$array = array (
'{ ' => '{ ',
' }' => ' }'
);
$content = strtr($content, $array);
return $content;
}
add_filter('the_title', 'clean_orphan_titles');
When I manually edit a title and add the
directly the plugin renders it fine but when the function does it the plugin doesn’t seem to like it. Can you offer any guidance? Like I say there were no issues with the previous version and no issues with titles in other widgets or plugins.Forum: Plugins
In reply to: [WordPress Popular Posts] Issue with non-breaking spaceApologies non breaking space code not showing above. I use