nickop
Forum Replies Created
-
Forum: Plugins
In reply to: [Contextual Related Posts] Is it meant to show twice?Thanks, I am considering changing it but will need some time to test. It would probably be the better solution I’m just wary of putting plugin-specific code in the general theme.
Forum: Plugins
In reply to: [Contextual Related Posts] Is it meant to show twice?Example URL in the first post.
I’ve put a fix in place. The blog post template was doing something like below to pull the author bio (I did not write it but can change it if you think there’s a better way?).
$book_page_description = get_post_custom_values(‘book_blog_page_description’,$about_page_detail[0]->ID);
…
<?php echo apply_filters(‘the_content’, $book_page_description[0]); ?>So since crp_content_filter only knows about the global $post, all the checks pass and the content is shown again. I introduced a global $shown_count to count how many times it was shown and skip it. For some reason by the time it gets to the 2nd instance set the counter is already up to 3 even though it starts at zero and should only go up by 1 if content is added.
I put some HTML comment echos to debug but it looks like there is some kind of recursive filtering going on that is being discarded since the comment next to the increment is only shown once in the source but the counter is still 3. Weird but I can live with it for now.
@jbmoore I can’t help you much, I just used chrome/firefox inspector to edit the HTML directly as a test. In the end I didn’t go for a permanent solution and found a FAQ module pack that Divi posted on their blog. Not as good as this one but good enough for what I was doing.
Just adding it seems to be a conflict with the Divi event handler in my case. Debugger never steps into the 2nd handler. But adding a data-target does still fix it.
I installed it a few minutes ago and it’s not working either. Fresh site with minimal plugins which is unpublished. Major one is the Divi theme.
Adding a data-target tag to the accordion items seems to fix it but I have seen working examples that do not have this so I am not sure what the issue is.