Keep formatting when posting content from a textarea to wordpress - wordpress

I'm using USP-Pro to let users post to a Wordpress blog. I have a textarea input in which they should put the main post content - the one that appears in the Wordpress admin editor. I'd like to keep the text formatting once they submit the form so I'm using CKEditor for that textarea.
CKEDITOR.replace('usp-content');
Checking the textarea with Firebug while I input the text shows that there actually is some HTML code inside, but when the form is submitted, in the editor I just see the raw text, without any formatting, which is pretty annoying because I lose all the spaces, the new lines and so on.
EDIT:
After various attempts I discovered that the problem is in the Wordpress function wp_strip_all_tags, inside the file wp-includes/formatting.php. I tried to comment it and it actually posted the content correctly with all the html in place.
Of course I can't just comment the whole function. How can I tell Wordpress to not use it when submitting such posts?

Related

Wordpress rss-feed is not showing ful text of a post

I have built a custom theme using understarp theme and I am unable to see summary or full text of my post in my RSS-feed. it starts showing text only when I add something in the excerpt field and still it shows only the content of excerpt field.
is it possible to show the full text of a post in RSS feed or no?
problem was, we were adding some ads HTML in the content of my posts using "the_content" filter and we were returning the updated content only in an "if" statement. I noticed there was no return statement for "else" so that's why it was giving me empty content

Remove the default style in <Pre> tag in wordpress post

I pasted a microsoft word post into my wordpress post and after posting the post has a grey background and a border around it. Why did it occur and how to remove this so that this does not happen every time I paste into my wordpress post.
Word puts a bunch of markup into your text. If you look at the plain text version, you'll see it's a mess. Use something like https://wordpress.org/plugins/mammoth-docx-converter/ to upload your Word docs to WP. It's not perfect, but gets you cleaner markup.

WordPress, code in html editor or code in index.php?

I'm volunteering to create a website and i've come across this dilemma with WordPress. Say the client deletes or edits a Page/Post in the visual editor, that could remove html code in the html editor.
The solution i've thought is to have text only in a Post, the html will be in index.php and the Page/Post will be fetched from index.php.
But for a particular page i have 30 pieces of text each inside an element with different colors. Would it be wise to fetch each individual Post from index.php or is there another way to prevent html code from being removed?
I'd like to point out, the client doesn't know anything about HTML, so i'd like to make it as easy as possible for them, simple editing of text and images. I don't want them to edit something in the future and the code is gone.
How do you WordPress developers approach this situation?
If you want this level of control, it is often helpful to use post 'custom fields'. This is pretty simple, it is a selectable field in the top dropdown when you are in the page/post editor.
http://codex.wordpress.org/Custom_Fields
You can then access the custom fields in your php files using the get_post_custom() function.
Here's more detail: http://codex.wordpress.org/Function_Reference/get_post_custom

Text in body (Basic Page) not displayed

I'm having trouble displaying the body text when creating a Basic Page. I've somehow deleted the body field at some point and then tried to add existing field again.
Now that I've added Body field again and typing in some text in the body for a Basic Page, it won't appear on my page. I can see my text in body_value in myphpadmin in field_data_body and my page is only displaying the title.
I've tried several things. Cleared cache, reapplied all template files (page.tlp.php etc.)
Im using Drupal 7.
Any help appreciated

CKEditor HTML CODE TROUBLE SHOOTING

My issue is I have a drupal site and I am trying to create a Make Payment page. I was able to create the page but the issue I ran into is when I got the code for the button from PayPal and inserted it into the CKEditor. The CKEditor works when I put it in there but it wont publish.
Any tips would be helpful.
You probably have to set the Input Format for that text box to "Full HTML". Otherwise a lot of the HTML tags will be stripped out when it is displayed.

Resources