• Resolved Nico Collu

    (@nico-collu)


    Hello,

    I have problems!!

    1. I want to create <div>‘s in the PHP code so that I can further edit the look of the widget. I want 3 div’s around the output code although I do not know how to do this, where the code is and if I can do it without copying the whole “wordpress-popular-posts.php” to my child theme?

    2. In wordpress post titles, I can add <br /> with the code working.
    It doesn’t work in the widget, can this be changed?

    //

    Here is a link where you can see what the blog posts look like and what the WPP widget looks like. Basically, I want to do what I have done in the picture “BLOG” with the picture “WPP” although this requires div’ing and for the to work.

    Hopefully you can help me!! 🙁

    / Nico Collu

    https://wordpress.org/plugins/wordpress-popular-posts/

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter Nico Collu

    (@nico-collu)

    Plugin Author Hector Cabrera

    (@hcabrera)

    Hi Nico!

    I believe that can be achieved using the Custom HTML Markup option from the widget. Use the “Before / after Popular Posts” fields to add your three extra DIVs and you should be good to go.

    Thread Starter Nico Collu

    (@nico-collu)

    Hey Héctor!

    Man, thanks for introducing me to “Custom HTML Markup”!
    That gives me the options I need!

    Did you read about quesiton nr. 2? How about making <br /> code working in the title?
    Do you think that this will be a possibility?

    / Nico Collu

    Plugin Author Hector Cabrera

    (@hcabrera)

    Man, thanks for introducing me to “Custom HTML Markup”!
    That gives me the options I need!

    No problem!

    How about making
    code working in the title? Do you think that this will be a possibility?

    Sorry, I missed that on my last reply. For reasons I won’t outline now because I’m feeling lazy and it’s friday (hehe), the plugin will strip all HTML tags from the post title (which explains why <br /> tags and others are missing).

    There’s a simple “hack” to have WPP keep all HTML tags in post titles:

    1. Go to Plugins > Editor and pick WordPress Popular Posts from the dropdown at the right.
    2. Find:
      // Strip HTML tags
      $title = strip_tags($title);

      … and change it to:

      // Strip HTML tags
      //$title = strip_tags($title);

    3. Hit the Update file button to save changes.

    Keep in mind that this modification will be lost next time the plugin gets an upgrade, so bookmark this topic for future references.

    Thread Starter Nico Collu

    (@nico-collu)

    Hey Héctor!

    No worries, I understand, haha, happy halloween!

    I found the code you want me to find in your wordpress-popular-posts.php and directly did it there. I guess I could copy that whole file to my child theme and it will stay although then I will most likely miss any awesome updates you come with like setting images to 100% for responsiveness, right, right? Hint! haha!

    Anyway man, thanks a bunch, I will try that out and set this topic as “resolved”.

    / Nico Collu

    Plugin Author Hector Cabrera

    (@hcabrera)

    I guess I could copy that whole file to my child theme and it will stay

    Unfortunately, unlike themes, there’s no such thing as “child plugins” 😛 (although that’d be useful for sure!)

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Help with div'ing the PHP for custom css'ing and more.’ is closed to new replies.