Author richardgb
2014
5
49
Premium
Ambassador
Rank 49

Several people have shown interest in better ways to create a Table of Contents. I'm sorry to say, this video is much longer than I intended ... with a little practice you can easily set up a TOC within 5 minutes or so!

As blocks are constantly being created and improved, it makes sense to constantly be on the lookout for blocks that can replace plugins. In general, blocks are lighter than plugins and help with page speed. Kadence TOC Block is one such ...

This video is my first and full of technical booboos. New software, new skills etc. They will get better!
:-)
Richard

Join the Discussion
Write something…
Recent messages
Elke63 Premium
Thank you Richard Gb for the video. I was just wondering yesterday how to incorporate a Table of Contenct into my bog. I was very happy that today I found your training and will now be able to crate a table of content into my bog.
Thanks again

Elke
Reply
richardgb Premium
Hey Ingrid ... that's great. If you have any questions, just ask...
:-)
Richard
Reply
ZachK Premium
Hey Richard,

Thanks for the training.

I think you did a great job, especially with your first video!

Can I ask you something?

It doesn't really have to do with setting up the table of contents, but about blocks and plugins in general.

Are blocks basically plugins that have different code or something that makes them work better with our websites, like as far as page speed and things like that are concerned?

Also, if so, do you think developers will be creating more of them for different areas so that we will be able to replace the plugins that slow down our sites?

Again, Many Thanks :)

Zach
Reply
richardgb Premium
Hi Zach
Thanks for your comment about the training.

Blocks are a tiny piece of code known nowadays as an "element" in WordPress.
Because elements are part of the WP code, as opposed to externally added code such as a plugin, they have a lower impact on page speed.

Not all plugins have an impact on page speed. For instance, the Kadence Blocks is a plugin that simply adds a pile of Blocks to what I think of as the Block store, within your implementation of WP and when they the Kadence blocks get used they become part of the WP code. I believe the Kadence Block plugin itself does no processing in the resultant site.

Another example is the Google Site Kit plugin which (I find very useful) connects Google Analytics and Google Search Console in the WP dashboard without any more overhead than the essential GA and GSC codes that are needed anyway.

My opinion is that it makes sense for WP, over time, to provide functions that the large majority of people use, within its own code, thereby cutting down on the number of plugins needed. As I mentioned in my latest post, WP has been slowly losing a technical battle against Wix and the like and I'm sure is keen to improve their position, at least back to where they were.
:-)
Richard
Reply
ZachK Premium
Richard, thank you for responding to my comment!

Also, I don't want to bug you, but can I ask you something else?

I installed the Kadence Blocks and used them to make a table of contents on my posts.

However, when I go to my posts, even using a different browser and an incognito tab they're not working correctly.

I'll explain, when I click on the top heading in my table of contents and go down and click on every other one in the order that they are on my table of contents it works fine.

Although, if I go to my posts and click like on the very bottom one first or a middle one on my table of contents first, for example, it doesn't go to the right spot and I don't mean it's off by a little bit, It's off by like half a page.

However, after I go to the bottom one or the middle first and it doesn't work right, when I go back to the table of contents without leaving the post and I click on other ones, even the same ones, it begins to work right.

I've tried changing the scroll offset, but it keeps doing the same thing.

Do you have any idea what might be causing this?

I hope it's not conflicting with my theme or any of my plugins. (I definitely want to keep my theme and I don't have too many plugins, but I'm pretty sure I need the plugins that I have)

I really like the way the kadence blocks work, and its table of contents, and the table of contents customizability.

I'm just hoping I can get it where it will work right for me!

Again, many thanks :)

Zach
Reply
richardgb Premium
It's no problem, Zach, except that I'm without a PC for a couple of days (moving house).
Well done on creating the TOC ... I haven't seen the problem you describe.

So first please check that you are using the Kadence block as opposed to the WP block.

Then do a little research for "Kadence Block Table Of Contents problem" or similar (no quotes).

If you can't wait a few days you might find that Phil (@feigner) has a little time to help.
Let me know how it goes and I'll get back to you in a couple of days.
:-)
Richard
Reply
ZachK Premium
Thank You, Richard,

Yeah, I just checked I'm using the kadence block table of contents.

I'll try researching to see if I can find anyone else who had this problem.
Reply
ZachK Premium
Hey Richard,

I just wanted to give you an update.

I did some research, but I ended up having to contact [http://WordPress.org Forums] and I put the title - Kadence Block Table Of Contents problem

This is what I put at the end of the info that I gave them: Do you have any idea what might be causing this?

This was their response:

"You bet, you are lazy loading images (usually a good thing) but your not using the browser lazy load instead a third-party. This means it's impossible to determine the scroll length of your headings until the images are loaded. For example, when you click a link it calculates initially the distance to scroll to get to the heading and it starts scrolling down, however that scroll down then triggers the images to load, and the distance to the heading changes.

To fix you need to load your images with intrinsic CSS so that the size of the image is correctly rendered even before the image is loaded Or you need to use a different lazyload (one that doesn't render at a height of 0 until the image loads. That will prevent the page size from changing when the images load. Unfortunately, there aren't great solutions for this yet, it would all be manual CSS or using the Kadence Gallery block and setting the gallery to be just one image in the grid format. (we are currently working on an image block that would be able to do this).

Ben"


I guess I'll probably have to quit using the table of contents since I don't have time to learn how to use CSS to do it manually right now.

Although, it is a shame since I really like the table of contents.

One last thing, if you have any ideas on something I can do to make it work that would be great!

Thanks,

Zach
Reply
richardgb Premium
Thanks for the update Zach.
I also lazyload images and see don't have this problem.
So as soon as I have time we should compare notes.
In the meantime, do you know what lazy load method (plugin) you're using?
:-)
Richard
Reply
ZachK Premium
Yeah, that would be awesome!

I'm using the "a3 Lazy Load" plugin.

When you get access to your PC again and have the time PM me.

I'll leave the table of contents on my articles until then (I'm not really looking forward to having to get rid of them anyway)

Thanks :)

Zach
Reply
richardgb Premium
Hi Zach ... OK!
Have you checked site speed recently? If not then run your site through Google Page Speed Insights.
Have you noticed if Cumulative Layout Shift (CLS) needs improving?

This could mean that lazy loading is causing a problem.

What happens is that lazy loading allows the front end to speed up but ... when the lazy-loaded image actually loads, all the surrounding text gets moved around and can cause users problems ... so ...
the way around this is to reserve some space in the page ready for when the image loads, so that when the image loads it gets dropped into a pre-prepared space, thus stopping the CLS.

I use a plugin called "Specify Missing Image Dimensions" for this. It checks out the dimensions of each image and creates a space for it upfront. All automatically ... if I remember rightly there's nothing to set up. Just upload and activate.

So:
1. Check page speed, especially CLS.
2. Learn what you can about CLS.
3. Try out the plugin to see if it makes a difference.
Ask any questions ...
:-)
Richard
Reply
ZachK Premium
Thanks, Richard!

I'll check my page speed and see what it says regarding CLS.

If CLS is lacking then I'll add the "Specify Missing Image Dimensions" to see if it fixes the problem.

Zach "The Prosperous View"

#ProsperousView
Reply
richardgb Premium
Please let me know how it goes, Zach.
:-)
Richard
Reply
ZachK Premium
I checked my page speed and it was lacking a little bit in the area of CLS.

So I added the Specify Missing Image Dimensions plugin.

However, the table of contents is still doing the same thing... @&%!... websites can be aggravating sometimes.

Zach "The Prosperous View"

#ProsperousView
Reply
richardgb Premium
Have you re-checked the CLS?
:-)
Richard
Reply
ZachK Premium
Thanks for helping Richard!

Yeah, I just checked.

It is still in the orange:
Cumulative Layout Shift
0.212

Zach "The Prosperous View"

#ProsperousView
Reply
richardgb Premium
OK Zach ... when you drill down into the detail of the CLS do you get any clues? Usually it's possible to identify the main cause ...
:-)
Richard
Reply
richardgb Premium
Hi Zach ... today I made a change to a TOC and experienced something like the problem you described. I cleared the cache at WA and in my browser and the problem went away ... (but my CLS is zero).
:-)
Richard
Reply
richardgb Premium
Hi Zach
I've just remembered and found how I reduced my CLS to zero!

It was in part sorted by the plugin I mentioned but ...
I also pre-load CSS, JS and Fonts via a little code.

I use a plugin called "Head, Footer and Post Injections" to add code to the header, footer and posts. I use this because other plugins don't provide the breadth (header and footer, but not posts) ...
but you can add the following code to the beginning of any header plugin ...

If you try this, I suggest you back up your site first. Nothing should get broken but better to be safe than sorry.

<! -- preload css, js and fonts to reduce CLS -->
<link rel="preload" href="styles.css" as="style">
<link rel="preload" href="ui.js" as="script">
<link rel="preload" href="/arial" as="font" type="font/format" crossorigin>

If you're not sure what to do with this, let me know and I'll give a little more detail.
Let me know how it goes ...
:-)
Richard
Reply
ZachK Premium
Hey Richard, when Kyle put out a post stating that WA would be using "The SEO Framework" plugin instead of the "AIOSEO" plugin, I replaced AIOSEO with The SEO Framework plugin.

Now, because of this, I had to install the "Ad Inserter" plugin in order to add the analytics code into the header of my website.

Could I just add the code that you just gave me into my site's header using the "Ad Inserter" plugin?

Thanks!

Zach "The Prosperous View"

#ProsperousView
Reply
richardgb Premium
Yes. I believe you can use Ad Inserter ... although since I haven't used Ad Inserter myself I can't tell you how to use it ... you know more than me on this. The important thing is that whatever tool you use, the code comes at the beginning of the header.
:-)
Richard
Reply
ZachK Premium
Ok, thank you, Richard!

Can I ask you just one more thing concerning the code though?

I know you said that you don't really know much about the Ad Inserter plugin, but with the Ad Inserter plugin, (now I would have to recheck to be sure) but I think you just click on the header tab and then add the code that you want to insert.

Also, I believe that we put all the code in the same spot in the Ad inserter Plugin that we want to be inserted into our header.

So, since I already have the code for my analytics there, do you think I can just insert your code underneath the analytics code or should I put your code above the analytics code in that spot?

What I'm asking is do you think it matters which one comes first since they will both be put in the header, either way, I'm pretty sure?

Zach "The Prosperous View"

#ProsperousView
Reply
richardgb Premium
Hi Zach
You should add the code above/before the analytics code.
:-)
Richard
Reply
ZachK Premium
Thank You, Richard!
Reply
Triblu Premium
Hey Richard,

Congratulations on submitting your first training. It will be easier going forward.

Besides, it's fun to share with others, right? ;-)
Reply
richardgb Premium
This might turn out to be a duplicate reply ... I tried to reply and the original disappeared ...
Thank you for the encouragement, Trish.
:-)
Richard
Reply
Triblu Premium
Ahhh, that explains why I'm getting others comments that appear to have disappeared.

Support sure has their work cut out keeping the site in top notch condition. I sure don't envy them their demanding job in keeping this humongous memberships site running smoothly.
Reply
StephenJacks Premium
Well done for your first video Richard

All the best

Steve
Reply
richardgb Premium
Thanks Stephen!
:-)
Richard
Reply
RCanty Premium Plus
I've been using LuckyWP. It does pretty good.

Canty
Reply
richardgb Premium
Hi Canty ... thanks for saying. I believe there are a few plugins that create good looking TOCs. This is more about replacing plugins with blocks, as blocks get better, since they generally enable faster page load speeds than most plugins.
:-)
Richard
Reply
RCanty Premium Plus
Kool, I didn’t realize page loading was affected.

Canty
Reply
Top