-
AuthorPosts
-
July 8, 2024 at 7:47 pm #1461629
Hello I was using Easy table of contents plugin, buy I have just realized that in the pages I have it the contact form is not working…..
But I have seen that you have a widget for Table of contents….
The think is that I need the table of contents :
1) in all individual post blog (but at the beginning, so in mobile it can be seen easily
2) and in all pages I have the [toc] shorcdode. (exmple https://faceclinic.es/clinica-capilar/injerto-capilar/)Is any way to use your “Table of contents”
Thank you!
July 9, 2024 at 6:11 am #1461651Hey carmen,
Thank you for the inquiry.
If you want to add the theme’s Table of Contents (TOC) to your pages, you can use the Widget Area element from the Advance Layout Builder (ALB). Just create a custom widget area, add the TOC widget, edit a page, add the Widget Area element, and then select the custom widget area. Let us know if this helps.
Best regards,
IsmaelJuly 9, 2024 at 6:45 am #1461655Hello, I don’t really think this works to me.
As I told you, I need table of contents in:1) POST: All post but at the beginning. If i put the widget area in the sidebar, in mobile appears at the end, not at the beginning.
2) PAGES: I have more than 800 pages and probably more in the future. I can not have 800 widget areas!! and modify 800 pages…..
Any other suggestion?
Or do you know any plugin working well with enfold?
Thank you!
July 9, 2024 at 7:06 am #1461658Hello I have use now “https://tocwp.com/docs/” Easy Table of Contents” – and as you can see here: https://faceclinic.es/clinica-capilar/injerto-capilar/ – in the pages “breaks” the columns….is there any way to fix that? I have also asked the plugin support…
Thank youJuly 9, 2024 at 7:26 am #1461660Hi,
Thank you for the update.
All post but at the beginning.
You can create a custom shortcode for the TOC widget, then use a template hook to automatically render the TOC on every post. Please add this code to the functions.php file:
add_shortcode('avs_toc', 'avs_toc_function'); function avs_toc_function() { $args = array( 'name' => 'Displayed Everywhere', 'id' => 'av_everywhere', 'description' => '', 'class' => '', 'before_widget' => '<section id="avia_auto_toc-2" class="widget clearfix avia_auto_toc">', 'after_widget' => '<span class="seperator extralight-border"></span></section>', 'before_title' => '', 'after_title' => '', 'widget_id' => 'avia_auto_toc_custom', 'widget_name' => 'Enfold Child Table of Contents', ); $instance = array( 'title' => 'Toc', 'exclude' => '', 'style' => '', 'level' => 'h1', 'single_only' => 1, 'indent' => 1, 'smoothscroll' => 1, ); ob_start(); $toc = new \aviaFramework\widgets\avia_auto_toc; $toc->widget($args, $instance); $output = ob_get_clean(); return $output; }
Then include this hook to render the TOC after the main title:
add_action('ava_after_main_title', function() { if(is_single()) echo do_shortcode('[avs_toc]'); }, 10);
Best regards,
IsmaelJuly 9, 2024 at 7:27 am #1461661Hello again, I have found the “problem”, It seems that the issue with the columns (which I have on all pages) occurs when they are set to “Equal Height”. When I select “Equal Height” with alignment set to top, center, or bottom, the columns “break” and appear incorrectly on the computer. However, when they are set to “Individual Height”, they work and display correctly. I don’t know if this gives you any clues……
The problem is that I need to have columns with equal height center, and also that I have this configuration in 800 pages!
Thank youJuly 9, 2024 at 7:56 am #1461662Thank you, but I’m not sure if I understand correctly. Do I need to go to each page and each blog post and add that code? That wouldn’t be feasible, as I have over 800 pages and almost 400 blog posts! I can’t do it manually on each page. It has to be something that works automatically.
I need the table of contents to be inserted automatically in blog posts, and for pages, I want it to work with a shortcode like [toc] so I can place it wherever I want. Is that possible?
July 9, 2024 at 8:13 am #1461665Hi,
I can’t do it manually on each page. It has to be something that works automatically.
You just have to add the code to the functions.php file. The hook should automatically render the theme’s TOC widget shortcode in every post, after the main title, so you don’t have to add it manually. Let us know the result. Please contact the plugin developers (Easy Table of Contents) for more info about the column issue.
Best regards,
IsmaelJuly 9, 2024 at 8:32 am #1461668Thank you but I dont understand where I have to place this? wich title?
Then include this hook to render the TOC after the main title:
add_action(‘ava_after_main_title’, function() {
if(is_single()) echo do_shortcode(‘[avs_toc]’);
}, 10);
———–
And what about the pages? it is enough having this: [toc] shortcode?
Thank you!July 10, 2024 at 7:44 am #1461746Hi,
All of the code that we mentioned above should be added in the functions.php file. If you need to render the TOC on pages, remove this code:
if(is_single())
Let us know if this helps.
Best regards,
IsmaelJuly 11, 2024 at 8:28 am #1461829Hello it was not working well, finally I use this plugin “TOP Table Of Contents” and seems it is working fine.
Thank you anyway!July 11, 2024 at 11:18 am #1461837Hi,
Thanks for the update, we’ll close this thread for now then. Please open a new thread if you should have any further questions or problems.
Best regards,
Rikard -
AuthorPosts
- The topic ‘Table of content’ is closed to new replies.