formatting posts in wordpress...

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • klinton
    So Fucking Banned
    • Apr 2003
    • 8766

    #1

    formatting posts in wordpress...

    Hello, what is best way for adding posts to wordpress ? I tried to make some html before in some wysiwyg editor, and copy and paste it later to wordpress, but wordpress editor seems to add <br> tag everywhere...... Do you know some EASY solution for making nice wordpress posts (like nice html sites), I mean with all images putted, videos embedded and so on....is there some nice editor to do it ?

    yeah i know i'm lame at wordpress.....but Thx
  • cyber
    Confirmed User
    • Jan 2004
    • 182

    #2
    Add this to your functions.php file:

    Code:
    function my_formatter($content){
      $new_content = '';
      $pattern_full = '{(\[raw\].*?\[/raw\])}is';
      $pattern_contents = '{\[raw\](.*?)\[/raw\]}is';
      $pieces = preg_split($pattern_full, $content, -1, PREG_SPLIT_DELIM_CAPTURE);
      foreach($pieces as $piece){
        if(preg_match($pattern_contents, $piece, $matches)){
          $new_content .= $matches[1];
        } else{
          $new_content .= wptexturize(wpautop($piece));
        }
      }
      return $new_content;
    }
    
    remove_filter('the_content', 'wpautop');
    remove_filter('the_content', 'wptexturize');
    add_filter('the_content', 'my_formatter', 99);
    now in any post you don't want WP to auto-format, type "[raw]" at the beginning of the post, and "[/raw]" at the end of the post.

    There is probably a plugin to do this. I'm not sure. Also, you can manually edit one of the WP core files to do this as well for all your posts.

    Comment

    • LoveSandra
      So Fucking Banned
      • Aug 2008
      • 10551

      #3
      bump bump

      Comment

      • cyber
        Confirmed User
        • Jan 2004
        • 182

        #4
        Originally posted by LoveSandra
        bump bump
        There's no need to bump this thread. it was JUST posted and I just answered it.

        I know you're not a bot, but you're just a person somewhere running up your post count by posting "bump bump" "thanks for this" "good luck" "2 cents" "lol" posts all day. My god that gets annoying, QUICK, when half the GFY posts are spamhumans.

        Comment

        • klinton
          So Fucking Banned
          • Apr 2003
          • 8766

          #5
          hey, thank you very much, i will try it....

          Comment

          • Supz
            Arthur Flegenheimer
            • Jul 2006
            • 11057

            #6
            If you use www.blogdesk.org application to create posts. There is a format function in this program that you can use. It is a great tool. You can also add custom fields and do a bunch of other cool stuff. Publish to multiple blogs so on so forth.

            Comment

            Working...