i.lychkov
Forum Replies Created
-
Forum: Plugins
In reply to: [Mark New Posts] Title duplicate on imageYou’re very kind, thank you! And thank you so much for the review.
Well, a bit disappointing that there was no success, but it’s been pleasure investigating this case with you, haha. Feel free to contact me anytime. Cheers!
Forum: Plugins
In reply to: [Mark New Posts] Title duplicate on imageHi, sorry for leaving you hanging!
As I understood, enabling the checkbox “Allow outside the post list”, which is supposed to make my plugin only work in the Loop, makes it so the New marks stop appearing in the blog’s post list, and yet they still keep appearing (in a glitched form) in the WP Bakery widget. The only thing I can suppose is that the post list in WP Bakery is considered to be in the Loop, while the blog’s list isn’t (which is kinda wild). So there’s no way for my plugin to determine that it should not be active in WP Bakery.
It seems to me that my plugin in its current form cannot be integrated with Ronneby or WP Bakery. Sorry ??
You can try contacting the theme’s support, but the problem seems a bit fundamental to be resolved right away – or at all. However, maybe they might suggest something after all.
Forum: Plugins
In reply to: [Mark New Posts] Title duplicate on imagePlease also try this one – in the same place in the .js file.
for (var j = 0; j < el.childNodes.length; j++) { var n = el.childNodes[j]; if (n.nodeType === 3 && n.nodeValue.indexOf('<mnp-mark>') !== -1) n.nodeValue = n.nodeValue.replace('<mnp-mark>', '').replace('</mnp-mark>', ''); }
Forum: Plugins
In reply to: [Mark New Posts] Title duplicate on imageI see. Well, let’s try this. Open wp-content\plugins\mark-new-posts\js\mark-new-posts.js, then after the 9th line add the following:
for (var j = 0; j < el.childNodes.length; j++) { var n = el.childNodes[j]; if (n.nodeType === 3 && n.nodeValue.indexOf('<mnp-mark>') !== -1) n.nodeValue = n.nodeValue.replace('<mnp-mark>', '').replace('</mnp-mark>', ''); }
After you’ve done editing the file, refresh the blog’s page with Ctrl+F5 (otherwise the old cached version of the js file will stay).
It’s a bit hacky, but if it will fix the markup, I’ll add it to the plugin.
Question: do you need the “New” markers to show at all in Custom WP Bakery? It’s going to be rather problematic if there’s a need for that.
Forum: Plugins
In reply to: [Mark New Posts] Title duplicate on imageTry turning off “Allow outside the post list”, does it help?
Forum: Plugins
In reply to: [Mark New Posts] Title duplicate on imageOkay, this is good! Though I can’t understand the remaining problem yet. Please explain it a bit more.
Also, let’s do another edit. Remove the ‘#’ character we added earlier and instead on line 63 change the number 10 to 100. Like this:
add_filter('wp_footer', array(&$this, 'marker_template'), 100, 2);
Tell me if the initial problem returns after doing this.
Forum: Plugins
In reply to: [Mark New Posts] Title duplicate on imageYou don’t have to go through all the cases anymore! Thank you for the effort. Just leave “Use JavaScript for showing markers” enabled.
Now I have to ask you to try adding some temporary edits in the plugin’s code. Open wp-content\plugins\mark-new-posts\mark-new-posts.php. Go to line 259. Add the symbol “#” in the beginning of the line, so it should become
# if (!$this->new_posts_displayed) return;
Tell me if the problem persists, and the console output too.
Forum: Plugins
In reply to: [Mark New Posts] Title duplicate on imageAh, I wish I could visit Italy one day!
Please do the following: open your blog page, wait for it to load, press F12, open Console, paste this:
document.getElementsByClassName('mnp-unread')[0]
and press Enter. Send me the response from the console.
Forum: Plugins
In reply to: [Mark New Posts] Title duplicate on imageYou’re welcome, that’s no problem at all!
So the problem is that the theme appears to try to output the post’s title in the alt attribute of the image by calling the WP function the_title(). My plugin intercepts each call to the_title() and injects the markup of the marker if the post is unread. That normally works okay with standard WordPress themes.
One possible solution is to use the “Use JavaScript for showing markers” option, which was designed specifically for this kind of situation, but the problem here is that, as you said, it doesn’t work for you. We can try troubleshooting it. Try enabling it once again, and then Inspect the post’s title, where the “new” text is expected to appear, and show me what you find there. Also check if there are any JavaScript errors in the console.
Another option, which is worse, is altering the theme’s code and removing the alt attribute from the image. This solution is bad, though, because each time the theme gets auto-updated, this “fix” will get overwritten.
Forum: Plugins
In reply to: [Mark New Posts] Title duplicate on imageHi! What theme are you using? Please send a screenshot of how the markup looks for the glitched portion of the page (right-click on the duplicated title text, click “Inspect”).
- This reply was modified 9 months, 2 weeks ago by i.lychkov.
Forum: Reviews
In reply to: [Mark New Posts] Can you do it for widget Recent Posts in sidebar?Извиняюсь, упустил. Поправил!
Forum: Reviews
In reply to: [Mark New Posts] Can you do it for widget Recent Posts in sidebar?I did some research and even asked on the support forum, and it seems it’s impossible to make the plugin work specifically in the Recent Posts widget or even just in the sidebar. So, as an alternative, I added an option to allow the plugin to work just anywhere outside of the post list. It just might work – please try the new version of the plugin.
Well, sorry to say, but the (a) option definitely is scary, and (b) doesn’t seem very elegant.
I thought of using the
the_widget
hook and setting a variable in my plugin totrue
when the “Recent posts” widget starts to render – and then I would just have to check the value of that variable in my code. But the problem is that I see no way of setting that variable back tofalse
once the widget is done rendering.Oh, I’m the developer of the plugin, haha. And I’m just looking for a way to implement that. And I mean the widget, yes.
Really, what I need is a function analogous to
in_the_loop()
that would instead detect whether a certain widget is being processed right now (or at least maybe just the sidebar in general).Forum: Reviews
In reply to: [Mark New Posts] Can you do it for widget Recent Posts in sidebar?Thank you for the review!
I might not be able to do it super quickly, but I’ll try to look into it.