Skip to content
Read For Learn
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP

How properly use social link block in template part

Different blocks work differently. Some blocks are just a comment, while some require HTML. Others depend on inner blocks for their actual content. The Social Links block is a wrapper block and each social link is a variation of the Social Link block.

But no matter how the block actually works, the easiest way to get the markup for use in a template part is to add it to the editor an copy and paste the result. If I add a Social Links block with two links inside it then this is what the markup looks like (indentation corrected for clarity):

<!-- wp:social-links -->
<ul class="wp-block-social-links">
    <!-- wp:social-link {"service":"facebook"} /-->
    <!-- wp:social-link {"service":"twitter"} /-->
</ul>
<!-- /wp:social-links -->

Related Posts:

  1. Where can I find the Gutenberg block icons?
  2. Add pre-publish conditions to the block editor
  3. How to filter or remove default panels in Gutenberg PrePublish Panel
  4. Deactivate Gutenberg tips forever – not Gutenberg
  5. How does Gutenberg handle translations in React?
  6. Add To Gutenberg Sidebar
  7. How to detect the usage of Gutenberg
  8. Integrate Gutenberg as a Standalone App
  9. Help Unregistering a Core Block Type in Gutenberg
  10. How do I register multiple blocks with block.json and register_block_type_from_metadata?
  11. Remove block styles in the Block Editor
  12. Disable Gutenberg text-Settings in all blocks
  13. How do I get the current post ID within a Gutenberg/Block Editor block?
  14. Looking for all available options of Gutenberg Block
  15. Possible to use @wordpress/create-block with multiple blocks?
  16. Are there ways to make the Gutenberg editor wider? And the HTML-block higher?
  17. Blocks: set a default value for a TextControl
  18. gutenberg block – how to force update after attribute changed?
  19. What is the advantage of ‘register_block_type’ (the PHP function) when creating custom blocks?
  20. How to trigger JS in gutenberg page load
  21. Allow excerpt for pages in Gutenberg?
  22. WordPress Gutenberg Embed Blocks Are Not Responsive
  23. Is there a list / reference for all current native WordPress blocks?
  24. Gutenberg: Block validation failed
  25. Set fullscreen mode by default
  26. How to query multiple post types inside Gutenberg options panel?
  27. How can I add a custom attribute to Gutenberg core blocks?
  28. Gutenberg extend core blocks
  29. Setting default font family with theme.json
  30. How can I access core/paragraph textColor in a block template
  31. (Gutenberg Block Editor) Using editor.BlockEdit filter, need to alter html/ CSS class of BlockEdit Component
  32. Add Button To Top Toolbar in Gutenberg
  33. Saving post meta using the new EntityProvider APIs
  34. Disable device preview options in the block editor
  35. Add additional classes to gutenberg .editor-styles-wrapper
  36. Implementing Gutenberg RichText onSplit / onReplace
  37. Change order/position of Gutenberg inspector control panel
  38. Get the current block ID
  39. Gutenberg Inspector Controls
  40. How to use the WordPress < LinkControl /> Component
  41. What version of Gutenberg is included with WordPress?
  42. Implement Panel Color Inspector Control in Gutenberg
  43. Add Formatting Buttons to Gutenberg core/paragraph BlockControls
  44. How do you use __experimentalLayout to give innerblocks alignment control and default layout?
  45. WordPress Value of Undefined in Admin
  46. Remove border radius setting from the Gutenberg button block?
  47. Extending Gutenberg group block: How to properly combine multiple attributes?
  48. serialize_blocks breaking html tags in content
  49. All post types with getEntityRecords
  50. gutenberg dynamic block is returning 404
  51. Modify the core/paragraph block
  52. Add PHP block template to content using wp_insert_post
  53. The Block Editor: Disable “Color settings” in the specific block
  54. Required (mandatory) Gutenberg block
  55. How to use getBlockIndex
  56. Gutenberg reusable blocks – is it possible to customise an instance?
  57. Gutenberg InspectorControls is deprecated, how to add custom block settings?
  58. Add classname to Gutenberg block wrapper in the editor?
  59. Hide or show Gutenberg custom block using date range
  60. How to disallow a certain custom gutenberg block outside of an InnerBlocks block?
  61. How should you internationalize javascript spread in multiple files but build in one?
  62. Use page Title in Gutenberg custom banner block
  63. How to add code to `head` with WordPress 5.9 FSE (Full Site Editing)
  64. Why is onChange={ ( content ) => setAttributes( { content } )} now used?
  65. Serialize custom block with InnerBlock
  66. How to develop custom blocks without triggering validation errors
  67. Dynamic gutenberg block with react instead of php
  68. get selected categories or tags (using javascript) in GutenBerg?
  69. File structure and react setup when creating multiple Gutenberg blocks
  70. Block Editor: add an aria-label to an option inside a SelectControl
  71. WordPress Gutenberg blocks: Input fields are not editable
  72. Gutenberg withInstanceId. When to use it?
  73. Gutenberg: Get All Attributes From «core/image» Block
  74. What replaces wpColorPicker in Gutenberg?
  75. How to make the Preview button automatically open new tab?
  76. Help with using getBlockIndex
  77. How to set column widths in a CPT block template?
  78. Gutenberg: How can I disable backspace key from deleting an empty paragraph block?
  79. Access GutenBerg data with Javascript?
  80. Gutenberg moving core blocks between categories
  81. Only show focused toolbar for Gutenberg Block with Multiple text fields
  82. Gutenberg: How to Change Post Status Programmatically?
  83. What’s the recommended Gutenberg component for adding a URL, in the toolbar/sidebar?
  84. Gutenberg block get categories in SelectControl
  85. Gutenberg Range Control default from meta value
  86. Gutenberg blocks – processing server data within a block
  87. How to access “default” property of attribute in Gutenberg
  88. Adding a custom PanelColorSettings control to a core block, and using the color slug in a custom className
  89. Once Again: How to Remove Option from Gutenberg Editor for Specific Block in theme.json
  90. Gutenberg Block manipulation: Undo parse_blocks() with serialize_blocks() results in unicode issues
  91. How to use “getEntityRecords” for user data?
  92. Where on Github, or elsewhere, can I find the code for core-blocks?
  93. Find all the places where a block type is used
  94. Enhancing Gutenberg featured image control
  95. Uncaught TypeError: wp.apiFetch is not a function
  96. Why is the new Gutenberg editor so narrow, and how to make it wider?
  97. WP Blocks – Gutenberg – not rendering $content
  98. how to get a more significant error response from ServerSideRender
  99. Align a custom block button by wrapping it in div
  100. Why does the custom HTML block not preserve the HTML characters?
Categories block-editor Tags block-editor, social-sharing
Renaming the ‘build’ directory generated by @wordpress/scripts for React development
Why does wp_query only display the most recent post when using order ASC?

Recommended Hostings

Cloudways: Realize Your Website's Potential With Flexible & Affordable Hosting. 24/7/365 Support, Managed Security, Automated Backups, and 24/7 Real-time Monitoring.

FastComet: Fast SSD Hosting, Free Migration, Hack-Free Security, 24/7 Super Fast Support, 45 Day Money Back Guarantee.

Recent Added Topics

  • Bug in translation system: load_theme_textdomain() returns true, files are available and accessible but the language defaults to english
  • Custom Elementor controls not appearing in the widget Advanced tab using injection hooks
  • Get the name of the template/*html file used
  • Trying to Add Paging to Single Post Page
  • Sharing media files between live and staging servers
  • How to display the description of a custom post type in the dashboard?
  • Critical error on image display
  • Copying WP data and files into new install?
  • How to determine the DirectAdmin WordPress backup date?
  • How to get list of ALL tables in the database?
© 2026 Read For Learn
  • Database
    • Oracle
    • SQL
  • algorithm
  • asp.net
  • assembly
  • binary
  • c#
  • Git
  • hex
  • HTML
  • iOS
  • language angnostic
  • math
  • matlab
  • Tips & Trick
  • Tools
  • windows
  • C
  • C++
  • Java
  • javascript
  • Python
  • R
  • Java Script
  • jQuery
  • PHP
  • WordPress