Hi,
the code needs to be customized on your needs, that snippet is just an example that does nothing.
Hi!
Ok, then how do I set it up on default wordpress with default theme?
You can see the theme in the post above, I provided the link.
Regards
This depends on how the theme is built, in any theme you need to put the php code in the functions.php but customizing based on your needs.
Every theme has a different HTML and CSS so it is on you customizing the code.
Are you writing the same thing on purpose?
I wrote you what site, I even gave you a link. You can look at this site, see the template. I even said what template is used. Is it really impossible to tell how to solve this problem in this template? Or are we going to beat around the bush?
“Every theme has a different HTML and CSS so it is on you customizing the code.” – Don’t write me an abstraction, please help me to find a solution specifically for my template. Are you tech support or what?
-
This reply was modified 1 month, 3 weeks ago by goncharovpro.
I am the tech support but also the plugin developer.
Template is a word that can indicate a lot of things based on the context, if you want to change the tooltip content for a different template you need to customize the PHP snippet to generate the HTML you need based on your theme or needs.
As example you need to wrap the tooltip with specific divs with specific CSS classes, likek to recreate a single page content? Or you are creating custom CSS rules? If you don’t specify what are you trying to do with details I can’t give you more hints on how to proceed.
The plugin offers filters and options, and the pro version offers more features for customization but anything requires to explain what are you trying to do. With the free support we don’t access to SFTP but we provide only replies in this forum.
I need all tags to be shown in the tooltip – h2, h3, a(link) etc..
p.s. about template – i meant theme
-
This reply was modified 1 month, 3 weeks ago by goncharovpro.
This code just get the term content and inject it as it is in the tooltip without truncation or clean up of HTML tags, but can create a lot of issues.
add_filter( 'glossary_tooltip_html', function( $tooltip, $excerpt, $photo, $post_id, $noreadmore ) {
return get_the_content($post_id);
}, 10, 5 );
I saw this solution in this topic https://wordpress.org/support/topic/tooltip-html-content-2/, which I indicated in my very first message. I tried this solution and it doesn’t work.
I pasted this code into the file function.php of the current theme and left it as is – look at how it is displayed on the site now. http://nomer8nv.bget.ru/hi/ This code displays the content of the current article. In fact, it duplicates it. But I need the content of the tooltip, not the article. Even if we do not take into account that the markup breaks, the code still does not work. It should display the content of the tooltip, not the article. Is there a solution?
The link http://nomer8nv.bget.ru/hi/ it is using the link mode not the tooltip mode, check your plugin settings https://docs.codeat.co/glossary/tooltips/
The discussion link you mentioned it was a discussion about how to change the content in the way he wanted, as you can see he uses the same filter but with different php code.
Do you even read what I write? Are you even trying to understand the problems of your plugin user? I have a feeling you don’t.
Did you follow my link earlier? If you had, you would have seen that the tooltip mode is used (Link and tooltip). At first it is like a pop-up tooltip, but after inserting the code you suggested, a duplicate of the same article is inserted into the article itself. And not even the content of the tooltip, but the article itself.
This is demonstrated now on this page. http://nomer8nv.bget.ru/hi/ . Its after inserting your code into the file function.php.
What other data do you need to understand the problem? I have provided you with all the data, I even made a special testing site that you could go to from the very beginning and look at.
I will repeat again. I need the text in the tooltip to be formatted (h2, h3, a(link) etc… a wrote about this), but after 10 messages you still have not offered a single solution, although all the data from my side was provided in the very first message.
And this is tech support??
-
This reply was modified 1 month, 3 weeks ago by goncharovpro.
I read it and also opened the link.
The HTML code for the tooltip is:
<span class="glossary-tooltip glossary-term-5" tabindex="0"><span class="glossary-link"><a href="http://nomer8nv.bget.ru/glossary/sample-tooltip1/" target="_blank" class="glossary-only-link">Sample tooltip1</a><!-- wp:paragraph -->
</span></span>
As you can see this means that is the link mode not the tooltip mode.
In that mode the tooltip is not generated with the content so the php code I shared to you is not executed.
This is clear that the http://nomer8nv.bget.ru/glossary/sample-tooltip1/ page of the tooltip is not printed in http://nomer8nv.bget.ru/hi/
Also as I don’t know what is the real content of http://nomer8nv.bget.ru/hi/ because with a lorem ipsum placeholder text repeated is not very clear for someone that doesn’t have the website access.
Until the tooltip is not executed in the page to me is impossible to help you to see what is happening.
I need the right and clear information to help you, also I need that you turn the tooltip mode in the plugin settings because you didn’t confirmed to me if it was already configured in that way.
Also consider that this is the free support and usually for the development stuff we don’t give so much support because we have the premium support and I am doing an exception because I am trying to understand what is happening in your website.
http://nomer8nv.bget.ru/Glossary_tooltip.mp4
I hope this makes it clearer.
Maybe I’m looking at the wrong settings?
-
This reply was modified 1 month, 3 weeks ago by goncharovpro.
-
This reply was modified 1 month, 3 weeks ago by goncharovpro.
A recap and a reply:
* You are using the Link and Tooltip mode
* The code I shared was incomplete:
add_filter( 'glossary_tooltip_html', function( $tooltip, $excerpt, $photo, $post_id, $noreadmore ) {
return '</span><span class="hidden glossary-tooltip-content clearfix"><span class="glossary-tooltip-text">' . get_the_content(null,false,$post_id) . '</span></span></span>';
}, 10, 5 );
This one recreate the HTML code required (taken from $tooltip) and inject the content of the term without any sanitization. In my test this create issues as in a post content there could be a lot of stuff that is not HTML valid inside a span, but this is on you.
Yes, the code is broken, but now at least I see something similar to what I needed.
Apparently, it is impossible to do it correctly in this plugin. I will use another one. I searched, it seems like “Tooltipy” does what I need. Thanks anyway for the help.
Regards