Support has been upgraded!
The Support Forum is closed. Not to worry! Providing the top quality support you expect and we're known for will continue! We're not ending support, just changing where you submit requests. This will provide you with the best experience possible.
Premium Support
Have you purchased an addon for Connections such as one of our premium templates or extensions with a valid license and you need help?
Please open a Support Ticket in your user account.
Free Support
Are you using the free Connections plugin? Don't worry, you are still very important to us! We are still providing you with the same high quality support that we're known for.
Please open a new support topic in the WordPress support forums for Connections.
Tagged: 8.5.3, add_action, cnShortcode, code snippet, filter, remove_filter, shortcode, single, the_content
- This topic has 7 replies, 2 voices, and was last updated 10 years, 7 months ago by
Chad Hassler.
-
AuthorPosts
-
11/10/2015 at 8:29 am #354332
Chad Hassler
ParticipantHi,
I am running my site locally, so hopefully I can explain this well enough. :)I am having an issue with my Single Entry pages not displaying correctly. Before today they were, but after I ran my first csv import they stopped working correctly.
Originally they would call in the same DIVs that my main page had on them. Now they do not. For example, I have a div with class named “lfg-wrapper” that shows up on the main category page as well as the individual category pages. Within this wrapper I have a background image and a couple other columns. But once I click on the organization name that wrapper (and all other divs within that wrapper) disappears.
The only thing I can remember doing different since it was working was installing the csv import plugin and running the importer.
Let me know if I need to clarify anything.
Thanks for your help.
Chad
11/10/2015 at 1:02 pm #354414Steven Zahm
Keymaster@ Chad
Recent version of Connections changed the way the single entry is displayed. Many users add “static” text and put the
[connections]shortcode on the page multiple times so I ended up spending a lot of time explaining why the text was duplicated and why the entry appeared on the page multiple times when viewing a single entry. My fix was to replace all the page contents when viewing a single entry with just the entry. This is why your wrapper code is not there when viewing a single entry.The only way to change this would be to remove the filter that does this. This should work:
Install the Code Snippets plugin.
Add a new snippet with the following code:
add_action( 'plugins_loaded', 'cn_remove_single_entry_shortcode_filter' ); function cn_remove_single_entry_shortcode_filter() { remove_filter( 'the_content', array( 'cnShortcode', 'single' ), 7 ); }Save and activate the new snippet.
Hope that helps!
11/11/2015 at 11:28 am #354553Chad Hassler
ParticipantThat did it. Thanks!
11/11/2015 at 1:50 pm #354567Steven Zahm
Keymaster@ Chad
Great to hear!
01/16/2016 at 12:35 pm #361407Chad Hassler
ParticipantHey Steven,
It appears that this problem is back. I think maybe it started again with the latest update. Do I need to modify my code snippet or is there something else that has happened. You can view the site now. Here is the category page:
http://sustainmc.chadhassler.net/lfg/cat/meat/and here is the single entry page:
http://sustainmc.chadhassler.net/lfg/name/moody-meats/As you can see the background and styling is no longer transferring over to the single entry pages.
How do I fix this and how can I avoid this issue in the future?
01/16/2016 at 12:39 pm #361408Chad Hassler
ParticipantI guess my links didn’t go through right. Here they are again:
Category Page
and
Single Entry PageHope that works better.
01/16/2016 at 8:30 pm #361437Steven Zahm
Keymaster@ Chad
Yeah, sorry, the code I gave will need tweaked just a really tiny bit.
add_action( 'plugins_loaded', 'cn_remove_single_entry_shortcode_filter' ); function cn_remove_single_entry_shortcode_filter() { remove_filter( 'the_content', array( 'cnShortcode', 'single' ), 6 ); }I had to increase the priority from 7 to 6 for the filter for compatibility reasons. Unfortunately WP requires the priority when removing filters so me changing the priority “broke” the code I gave because the priorities no longer matched.
Apologies for the trouble, hope this helps!
ps. I don’t often change filters or priorities… only when I need to for compatibility or conflicts with other plugins/themes so you should not encounter this too often… or maybe never again, I hope.
01/18/2016 at 4:26 pm #361578Chad Hassler
ParticipantThanks Steven. That fixed it.
Thanks for your quick response. I appreciate it!
-
AuthorPosts
You cannot reply to this support topic. Please open your own support topic.
