Hi Duncan,
Could you please set the WP_DEBUG to true and check the page on the front end where you added the shortcode? Let me know if you see any errors.
Hi Richard, thanks and clearly having a blonde moment. I think i added this correctly to wp-config and changed to “true” but still do not see any change to front end template that this was added to?
So you don’t even see the shortcode in plain text, either? If you want, I can help you if you email me temporary access. I’m also working on a simpler version of this if you prefer.
I finally got it to work. But I did see a few reasons it wasn’t working.
1. I didn’t see where you added the function for the Read More, Read Less that I created, so I added it to your Child’s function.php.
2. The caching plugin or Autoptimize was preventing the shortcode from rendering.
3. The third reason is something I have to adjust on this post because I realize that besides the fact that Vuejs uses a virtual dom, if there is an optimization plugin such as the one you have, then the javascript I created would show as null because the virtual dom has not finished. So I added a function to the code for it to run after the window has loaded.
Thanks Richard and looks great. Sorry for your troubles and hope the coffee helps.
How did you get around the caching/plugin issue – i have other sites i am working on and would like to copy what you have done here without the same issues.I assume i can now copy what you have done here on to the other post types within this site as you have fixed the code to work as mentioned?
Also I did copy your code above but i see the one you used in the PHP had an initial line that is not present above.
I received your mails but when i reply it bounces back as undelivered and failed.
host mail.binaryblackboard.com [190.92.157.124]
SMTP error from remote mail server after end of data:
550 “The mail server detected your message as spam and has prevented delivery.”
Hi, I should probably remove that since most just add the code to the fuctions.php file. I had created a plugin that added the feature, but I know most people don’t like to add more plugins. You can just add the code to your functions.php file in the child theme. I’m going to remove step three. Thanks!
Hi, I added the code to the function.php child theme file.
For shortcode I left only [paragraph-expander].
I still got the same results – only the button at the very top above the content is visible, while the text is fully expanded. Thanks 🙂
Hi, I think the issue may be that the Voxel text editor widget automatically adds paragraph tags which then breaks my code. Please try removing the “p” on lines 25, 34, 66, and 67
Please let me know if this helps. You can contact me through the contact page and send me a screenshot of the page source to see if the paragraph tags are added or not. Cheers!
Hi, I haven’t tested with the very latest version. Are you getting any errors? Did you have this working before? Or is this the first time you are adding this feature?
15 Comments
Hi Richard,
I love this and have tried to add this widget and the code etc as above but for some reason it doesn’t show or work?
Any ideas as to why this might be? I have some profile listings that are very long and this would be awesome to include
Hi Duncan,
Could you please set the WP_DEBUG to true and check the page on the front end where you added the shortcode? Let me know if you see any errors.
Hi Richard, thanks and clearly having a blonde moment. I think i added this correctly to wp-config and changed to “true” but still do not see any change to front end template that this was added to?
So you don’t even see the shortcode in plain text, either? If you want, I can help you if you email me temporary access. I’m also working on a simpler version of this if you prefer.
I now see the plain text code on the front end – also have sent you a mail via your contact page :). Thanks Richard.
I finally got it to work. But I did see a few reasons it wasn’t working.
1. I didn’t see where you added the function for the Read More, Read Less that I created, so I added it to your Child’s function.php.
2. The caching plugin or Autoptimize was preventing the shortcode from rendering.
3. The third reason is something I have to adjust on this post because I realize that besides the fact that Vuejs uses a virtual dom, if there is an optimization plugin such as the one you have, then the javascript I created would show as null because the virtual dom has not finished. So I added a function to the code for it to run after the window has loaded.
Thanks Richard and looks great. Sorry for your troubles and hope the coffee helps.
How did you get around the caching/plugin issue – i have other sites i am working on and would like to copy what you have done here without the same issues.I assume i can now copy what you have done here on to the other post types within this site as you have fixed the code to work as mentioned?
Also I did copy your code above but i see the one you used in the PHP had an initial line that is not present above.
Please check your email. And thanks for the coffee!
I received your mails but when i reply it bounces back as undelivered and failed.
host mail.binaryblackboard.com [190.92.157.124]
SMTP error from remote mail server after end of data:
550 “The mail server detected your message as spam and has prevented delivery.”
Hi Richard,
What did you mean when you wrote:
Step Three:
Install and activate the plugin.
What plugin are you writing about?
I followed all the steps but read more does not work – see the video.
Video – https://www.loom.com/share/571aae2d05d14a91a2275188b4f93158
Thanks
Hi, I should probably remove that since most just add the code to the fuctions.php file. I had created a plugin that added the feature, but I know most people don’t like to add more plugins. You can just add the code to your functions.php file in the child theme. I’m going to remove step three. Thanks!
Hi, I added the code to the function.php child theme file.
For shortcode I left only [paragraph-expander].
I still got the same results – only the button at the very top above the content is visible, while the text is fully expanded. Thanks 🙂
Hi, I think the issue may be that the Voxel text editor widget automatically adds paragraph tags which then breaks my code. Please try removing the “p” on lines 25, 34, 66, and 67
Please let me know if this helps. You can contact me through the contact page and send me a screenshot of the page source to see if the paragraph tags are added or not. Cheers!
Hello,
does this code still valid for the current Voxel version? I tried to use it but seems it not working for me.
Will appreciate any help:)
Hi, I haven’t tested with the very latest version. Are you getting any errors? Did you have this working before? Or is this the first time you are adding this feature?