cant pass basic HTML into widgets

Discussion in 'WordPress' started by saturn100, Jun 26, 2014.

  1. #1
    Hi
    I am using wordpress at the moment to design some site
    I am not over familiar with it and having some issues

    basically I have two widgets that place text from certain posts on a page
    The only problem is the widget isn't picking up the formatting of the text
    Even basic HTML code like bold or underline

    Is there any way to fix this within the dash board, a plug is or hard coding the wordpress files


    Thanks
     
    saturn100, Jun 26, 2014 IP
  2. yanpub

    yanpub Member

    Messages:
    98
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    31
    #2
    change the theme. must be a error there. Usuall yo can use div style on widgets if you want
     
    yanpub, Jun 26, 2014 IP
  3. ivantk

    ivantk Active Member

    Messages:
    183
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    53
    #3
    You can deactivate all plugins and test if it works or not. If one the plugins is causing the problem you can start activating them one by one.
     
    ivantk, Jun 27, 2014 IP
  4. TIEro

    TIEro Active Member

    Messages:
    741
    Likes Received:
    177
    Best Answers:
    5
    Trophy Points:
    70
    #4
    Chances are the widgets are stripping out HTML, since it can be dangerous. Which widgets are you using? Did you write them? Have you tried them on a clean setup, with no plugins or anything? Have you tried them on the basic Twenty Fourteen theme, to see if they work there?
     
    TIEro, Jun 27, 2014 IP
  5. saturn100

    saturn100 Well-Known Member

    Messages:
    465
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    111
    #5
    Hi
    The theme I was given and have to be use
    I did not write the widgets

    I did some research and googling and found code on the internet to make the titles pass HTML
    but I am still working on the posts themselves

    http://premium.wpmudev.org/blog/wordpress-widget-title-html/

    I was trying to use the code and change it to "$showposts" like so

    
    function html_widget_showpost ($showposts) {
    
    //HTML tag opening/closing brackets
    $showposts = str_replace( '[', '<', $showposts );
    $showposts = str_replace( '[/', '</', $showposts );
    // bold -- changed from 's' to 'strong' because of strikethrough code
    $showposts = str_replace( 'strong]', 'strong>', $showposts );
    $showposts = str_replace( 'b]', 'b>', $showposts );
    return $showposts;
    }
    add_filter('widget_showpost' , 'html_widget_showpost');
    
    Code (markup):
    But its not working
    Is showposts the right pentameter

    these are the ones listed in the widget file
    $title
    $category
    $cols
    $showposts
    $longdesc
    $customclass
    $linktitle
    $disabletext
     
    saturn100, Jun 30, 2014 IP
  6. chiragagarwal1991

    chiragagarwal1991 Member

    Messages:
    9
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #6
    Can only be a theme issue. Revert back to the default theme and see if your widget css is working. If it works, your theme needs a check.
    Else, if you want, share your Wordpress details with me(over PM) and I can see for you :)
     
    chiragagarwal1991, Jun 30, 2014 IP