Tag Info

New answers tagged

0

Why don't you use WP_Query. You can pass array as parameter. The array can contain category, number of posts, order etc. Then you can use the while loop to display posts and wrap them in html. Please go to http://wordpress.org and look for WP_Query for further details.


0

By default WordPress adds lots of CSS classes in body tag automatically. These body classes are very useful for styling different sections/pages of site without needing to edit theme files unnecessarily. For example WordPress add home CSS class on website front page and blog class on blog posts index page. Similarly in your case, since you are using a ...


0

@qwerty, I was having a similar issue and I was able to use http://codex.wordpress.org/Function_Reference/wpautop Some more info on this thread: get_post_custom stripping styling issue


2

If the line breaks exist in the database, you just need to run your custom field output through wpautop(). Changes double line-breaks in the text into HTML paragraphs (<p>...</p>). If that doesn't work, then the line breaks probably are getting stripped before going into the database. In that case you'll need to share the code that saves ...


0

The form is generated in file wp-admin/edit-form-advanced.php. The relevant code starts at line 410 (WP version 4.0.1). Inside the <form> tag an action is fired: <?php do_action( 'post_edit_form_tag', $post ); ?> so it should be easy to use this action by hooking some small function to it from functions.php: function post_form_novaidate() { ...


0

This worked for me: Use esc_html() when you save your metabox text: $my_data = esc_html( $_POST['my_value'] ); // Update the meta field in the database. update_post_meta( $post_id, '_my_field', $my_data ); Retrieve your metabox text as usual: $value = get_post_meta( $post->ID, '_my_field', true );


0

I was attempting to do the same thing. I found cloudconvert which seems to do a nice job of this (no affiliation to me). It's not a drop-in solution but it is something that could work. They have a free tier of usage and reasonable prices beyond that. You can also try just using the 'Save as HTML' from Word which gets pretty close.



Top 50 recent answers are included