- This topic has 8 replies, 3 voices, and was last updated 4 years, 10 months ago by
David.
-
AuthorPosts
-
July 17, 2021 at 3:49 am #1858828
CRAIG
I use Lucky WP table of contents and there are a couple of options to insert the table of contents
1. Auto-insert – you can select post type (post,page,media,wptb tables) and also the position (before first heading,after first heading,after first block (paragraph or heading),top,bottom)
2. Shortcode
If I was using posts this would be perfect, as I could just select auto-insert, posts, after first block (paragraph or heading) and this would add my table of contents after the introduction paragraph exactly as I want it.
However, I am going to be using pages for my blog content and not posts (for various reasons – don’t ask) and this presents a slight problem because on several of my pages I don’t want a table of contents.
I was thinking one way to solve this might be to select the table of contents to appear on pages, but then have some way of blocking it from showing on the pages where it is not required e.g. home,contact,about,privacy etc.
I’m just not too sure of how to do that.
I do have some elements which are set up to perform actions on pages, excluding the “non-blog” ones referred to above. Perhaps I could add a little bit of code to one of those?
Thankful for any help
July 17, 2021 at 6:25 am #1858941David
StaffCustomer SupportHi there,
you could add the Shortcode they provide using a Hook Element, as you have with other elements and set the Display Rule Locations / Exclusions.
July 17, 2021 at 2:19 pm #1859414CRAIG
Hi David,
If I insert via shortcode I cannot set the position of the table of contents via the plugin so I’ll need to do that in the hook.
Is there a way I can set the position of the shortcode to after the first paragraph in the hook settings?
I can see options like generate_after_entry_content but this doesn’t have the desired effect.
July 17, 2021 at 2:48 pm #1859420Ying
StaffCustomer SupportHi Craig,
Unfotruanly GP doesn’t have Hooks inside content.
Since you are using the Lucky WP table plugin, have you tried reaching out to the plugin’s support?
I think they’ll be able to give you some code to exclude the function from some specific pages.July 17, 2021 at 3:02 pm #1859422CRAIG
Hi Ying,
That’s a shame
I need the table of contents to appear automatically on all future pages published except the excluded pages in the display rules
I’ll reach out to their support and see what they say
July 17, 2021 at 4:21 pm #1859442Ying
StaffCustomer SupportWe might be able to provide some CSS to hide the table on the front end, but if you want them to do not appear in the HTML at all, you’ll have to reach out to the plugin support.
Let me know if you need further assistance 🙂
July 18, 2021 at 1:51 am #1859660CRAIG
I just jumped onto the support forum for the plugin LuckyWP Table of Contents and it looks as though no-one is getting a response from the developer anymore
I will use another plugin for this, but I will see if I can find one which supports my requirements out of the box
***update – I have installed Easy Table of Contents***
This plugin seems to have a little bit more flexibility.
Still need help to move the TOC to after the first paragraph
July 18, 2021 at 3:10 am #1859707CRAIG
I’ll just manually insert for now
July 18, 2021 at 7:43 am #1859808David
StaffCustomer SupportYou could try adding it using the Ad inserter plugin – but i cannot say if they play well together.
If not manual insertion is the way to go. -
AuthorPosts
- You must be logged in to reply to this topic.