Changing the code format for wordpress

First thing’s first, we need to get our globals. If you’re in The Loop you can remove the global $post in my code, if you’re outside The Loop $post may not be what you expect it to be. We’ll always need the global $userpro though. <?php global $userpro, $post; ?> <div class=”myrelatedauthor”> <a href=”https://wordpress.stackexchange.com/questions/180751/<?php echo … Read more

Trim content without stripping formatting

Well, as far I understood you want to remove all the HTML tags from the trimmed the_content. Right??? Try wp_filter_nohtml_kses function. Hope that’s going to work. Here is the full code- <?php $trimmed = wp_filter_nohtml_kses( wp_trim_words( get_the_content(), 55, “” ) ); ?> <?php echo $trimmed; ?>

Formatting poetry in wordpress

I hope I’ve understood your question correctly. As you probably gathered, if you are in the visual editor, hitting return creates a new paragraph, but hitting Shift-return creates a line break. A couple of possible solutions: A very basic one. You should be able to make specific indents with a mixture of lines with line … Read more

How do I format the date in Event Organizer?

%start{date-format}{time-format}% (using php date format) for example: %start{M jS, Y}{ g:i:a}%* This will output as June 17, 2012 11:00am Shortcode: [eo_events]<a href=”https://wordpress.stackexchange.com/questions/53851/%event_url%”>%event_title%</a> on %start{M jS, Y}{ g:i:a}%, at %event_venue%[/eo_events] Referance: Event Organiser

Linebreaks behaving oddly inside blockquotes

br and p tags get stripped out and converted to newlines, they’re not added until the post content is output. See the codex entry for the wpautop function, this is what is converting those newlines to br and p tags on the_content. It’s difficult to say what exactly is going here in this case though. … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)