Adding Breadcrumbs with GeneratePress and GenerateBlocks Tutorial

This tutorial introduces the use of GeneratePress respond in singing GenerateBlocksThe Block Hook element makes it easy to add breadcrumb navigation to your website and improve page navigation. The example uses the Yoast SEO The plugin's breadcrumb feature, the method applies to other SEO plugins (e.g. Rank Math) by simply replacing the corresponding shortcode.

利用 GeneratePress 和 GenerateBlocks 添加面包屑导航的简易教程
An easy tutorial on adding breadcrumb navigation with GeneratePress and GenerateBlocks.

I. Preparatory work

Make sure that the Yoast SEO plugin is installed and enabled (or another breadcrumb-enabled SEO plugin) and the breadcrumb feature is turned on.

图片[2]-利用 GeneratePress 和 GenerateBlocks 添加面包屑导航的简易教程

Second, create a new element and add breadcrumbs short code

  • Go to the backend "Appearance → Elements" and click "Add New Element".
图片[3]-利用 GeneratePress 和 GenerateBlocks 添加面包屑导航的简易教程
  • Element type selection Hook
  • The hook name is set to before_entry_titlei.e. show breadcrumbs before the title of the article
图片[4]-利用 GeneratePress 和 GenerateBlocks 添加面包屑导航的简易教程
  • Add Shortcode Block
图片[5]-利用 GeneratePress 和 GenerateBlocks 添加面包屑导航的简易教程
  • Paste Yoast SEO in shortcut block crumbShort code:[wpseo_breadcrumb] (For other plug-ins, please use the corresponding short code)
  • Select the display location to be the All Posts page and click Publish
图片[6]-利用 GeneratePress 和 GenerateBlocks 添加面包屑导航的简易教程

III. Styling breadcrumbs (optional)

Add a new container block, drag the shortcut block into the container and make sure the container wraps the shortcut block

图片[7]-利用 GeneratePress 和 GenerateBlocks 添加面包屑导航的简易教程

Adjust the breadcrumb appearance using the container block style:

  • Change text color (e.g. blue)
  • Modify link color (e.g. pink)
图片[8]-利用 GeneratePress 和 GenerateBlocks 添加面包屑导航的简易教程
  • Set background color (e.g. gray)
图片[9]-利用 GeneratePress 和 GenerateBlocks 添加面包屑导航的简易教程
  • Adjust the inner margin (Padding), it is recommended to standardize it to 5px.
  • Add bottom outer margin (Margin) to increase spacing between breadcrumbs and headings
图片[10]-利用 GeneratePress 和 GenerateBlocks 添加面包屑导航的简易教程

Effect Preview:

图片[11]-利用 GeneratePress 和 GenerateBlocks 添加面包屑导航的简易教程

Fourth, add breadcrumbs in the page banner (Page Hero)

  • Sets the previously created breadcrumb element to draft status
图片[12]-利用 GeneratePress 和 GenerateBlocks 添加面包屑导航的简易教程
  • Open single post page banner element (Single Post Hero)
图片[13]-利用 GeneratePress 和 GenerateBlocks 添加面包屑导航的简易教程
  • Add a shortcut block inside the banner and paste the breadcrumb shortcode
  • Move the shortcut block above the title
图片[14]-利用 GeneratePress 和 GenerateBlocks 添加面包屑导航的简易教程
  • Save the update and refresh the page to see the breadcrumbs displayed in the page banner
图片[15]-利用 GeneratePress 和 GenerateBlocks 添加面包屑导航的简易教程

summarize

utilization GeneratePress respond in singing GenerateBlocks Block Hook function, add thecrumbThe navigation is simple and flexible, and the style can be freely adjusted. Combined with SEO plugin short code, it can realize efficient navigation effect improvement.

Recent Updates


Contact Us
Can't read the tutorial? Contact us for a free answer! Free help for personal, small business sites!
客服微信
Customer Service
Tel: 020-2206-9892
QQ咨询:1025174874
(iii) E-mail: [email protected]
Working hours: Monday to Friday, 9:30-18:30, holidays off
© Reprint statement
本文作者:托尼屎大颗
THE END
If you like it, support it.
kudos5324 share (joys, benefits, privileges etc) with others
commentaries sofa-buying

Please log in to post a comment

    No comments