Viewing 15 replies - 1 through 15 (of 17 total)
  • Plugin Author jazzs3quence

    (@jazzs3quence)

    Can you reproduce that issue with a different theme? If the problem can’t be reproduced in a different theme (like one of the default WordPress themes, i.e. Twentyten, Twnetyeleven, Twentytwelve, etc), then the problem exists in the theme and you should contact the theme developer for support. It’s unfortunate, because the reviews look really nice in that theme, but I suspect the theme developer is doing something wrong which is causing the issue. I tested the plugin on several themes from www.ads-software.com and didn’t see any issues like this.

    Thread Starter divinemagazine

    (@queertownabbey)

    The first issue with the book information below the wp menu was caused by this plugin https://www.ads-software.com/plugins/facebook-thumb-fixer/

    The second issue with the information next to the image is caused by our template.

    Unfortunately If I ask the theme developer for help I will probably get the thypical answer: I don’t support third party plugins as there are thousands out there that work in different ways, it would be impossible for me to know them all.

    Thread Starter divinemagazine

    (@queertownabbey)

    I still have a strange layout as you can see here https://queertownabbey.com/book-reviews/ but that is probably caused by the template.

    Plugin Author jazzs3quence

    (@jazzs3quence)

    That strange layout issue I can help you with — and is fairly easy to fix. If your theme has a custom CSS panel, add this:

    #content h3 {
         clear: both;
    }

    If not, grab a plugin like My Custom CSS or, if you’re using Jetpack, you can add it in the Edit CSS page under Appearance.

    The text being added next to the image is a fairly obvious bug in the code which you can see in this screenshot: https://cl.ly/image/1e1L2L1X3X1h

    In this screenshot of the source you can see there’s a link tag with another link tag inside it. There’s some extra meta data being added to the link which could be coming from the theme or could be coming from another plugin, but whatever is doing it, it’s not stripping the HTML before displaying it, causing a link inside of a link and the broken code. My guess is that this is probably not the theme either, but I can’t know that for sure. Again, if you can switch to another theme, and reproduce it, that will tell you if it’s a theme issue or a plugin issue. If it’s a theme issue, that’s a pretty big oversight and hopefully the screenshot will help the author identify the issue as it is definitely a bug in the code. (What he should be doing is wrapping that title output in strip_tags() before echoing it into the title parameter of the link.)

    Plugin Author jazzs3quence

    (@jazzs3quence)

    In fact, looking again at the code, I know what’s happening. He’s using the_title() to display the post title in the link’s tag. Normally that would be okay, but I’m also using the_title() and filtering it to add a link to the author. So, what the code should look like is this:

    <a href="<?php // the image url goes here ?>" title="<?php echo strip_tags( get_the_title() ); ?>">
         <img src="<?php // url to the thumbnail" />
    </a>
    Plugin Author jazzs3quence

    (@jazzs3quence)

    …and you know, it’s probably the same issue with the facebook thing, as well. Because the Facebook plugin is adding metadata and probably calling the_title() and if there’s HTML in that string (which there is), particularly if there’s a link (again, there is), it’s breaking the rest of the HTML tag and closing the tag before it’s done doing it’s thing.

    It’s possible I may be able to make my title filter a bit more specific so if the_title() is called somewhere other than where it normally is called (like in the <head> or in an tag), it doesn’t break stuff. I’ll look into it and see what I can do

    Plugin Author jazzs3quence

    (@jazzs3quence)

    I have a fix ready that will work for the Facebook thing. Still need to figure out if there’s a way to make it work for the thumbnails…

    Plugin Author jazzs3quence

    (@jazzs3quence)

    Nope, I can’t think of a way to prevent the filter from running inside an HTML tag if that tag is in the regular content area. I can do it if it’s outside the content area, like with the Facebook data, which is happening in the header, but once you’re inside the content area it’s either going to filter it always or never (which would remove the author and link to the author in the title. Anyway, the thing is that this is exactly the argument for sanitizing data being sent from the database when you’re dealing with display files (like theme template files) — because had the title been sanitized before it’s displayed on the page, it wouldn’t break the content and you wouldn’t have the problem. So, for that, I go back to my original fix in the theme here.

    If you show the theme author what it’s doing and tell him to use strip_tags around that the_title call in the link text, it should be an easy fix and it should resolve the issue.

    Plugin Author jazzs3quence

    (@jazzs3quence)

    Okay, so I know I’m spamming this forum but can I ask you a question and see if this works?

    What if I added an option to the options page that was like “Display book author with book title” and could be enabled or disabled? If enabled, it does what it normally does, you get: This Book by Some Author. If disabled, it will just display the book title — which will solve the issue you’re having in your theme.

    Then, where the book information displays (genre info, etc), It will say:
    Author: Some Author

    Does that work? My inclination is to have the author’s name up higher, closer to the title, would it be better if it displayed before the review instead of after? Do you have other ideas that could work?

    Basically I’m trying to figure out ways to opt-out of lumping the book author (and the associated HTML link to that author’s book list) from the title, so people who run into this issue can fix it from the back-end.

    Thread Starter divinemagazine

    (@queertownabbey)

    Thanks for all yor help but I gave up the old WP theme since it gave me so much headache.

    I have now switched to a clean and professional, yet minimalist design https://www.solostream.com/wordpress-themes/wp-brilliance/

    This WP theme is so much faster.

    Could you please help me fix the layout issue here https://queertownabbey.com/book-reviews/

    Plugin Author jazzs3quence

    (@jazzs3quence)

    You know what, hang tight and I’ll just add a fix for that into the plugin.

    Plugin Author jazzs3quence

    (@jazzs3quence)

    Okay, look for version 1.0.3 and see if that takes care of it for you. Let me know if you’re still getting layout problems. I’ll mull over the other thing and maybe add that in a future update.

    Plugin Author jazzs3quence

    (@jazzs3quence)

    Looks like that theme is doing the same thing: https://queertownabbey.com/book-review/the-passionate-attention-of-an-interesting-man/

    It’s because of the filter I add to the title and because the theme(s) aren’t sanitizing that before outputting it because they aren’t expecting it to be any different than what you added in the post title (which doesn’t take into account plugins doing what I’m doing).

    Thread Starter divinemagazine

    (@queertownabbey)

    Thanks Chris. version 1.0.3 solved the layout problem

    Plugin Author jazzs3quence

    (@jazzs3quence)

    Great. I’ll call this resolved, but I’m still going to look into adding an option that will be an alternative to modifying the title for the situations where the theme uses the title inside HTML tags and gets broken as a result.

Viewing 15 replies - 1 through 15 (of 17 total)
  • The topic ‘Layout problems with your plugin and our WordPress theme’ is closed to new replies.