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. Add pre-publish conditions to the block editor
  2. How does Gutenberg handle translations in React?
  3. How can I access core/paragraph textColor in a block template
  4. Saving post meta using the new EntityProvider APIs
  5. Implement Panel Color Inspector Control in Gutenberg
  6. gutenberg dynamic block is returning 404
  7. Gutenberg InspectorControls is deprecated, how to add custom block settings?
  8. How should you internationalize javascript spread in multiple files but build in one?
  9. Why is onChange={ ( content ) => setAttributes( { content } )} now used?
  10. How to set column widths in a CPT block template?
  11. Access GutenBerg data with Javascript?
  12. Only show focused toolbar for Gutenberg Block with Multiple text fields
  13. Gutenberg: How to Change Post Status Programmatically?
  14. Adding a custom PanelColorSettings control to a core block, and using the color slug in a custom className
  15. Enhancing Gutenberg featured image control
  16. Is it possible to create column width presets in Gutenberg?
  17. How to define a Block Style in an Innerblocks template
  18. Option for removing block not appearing in custom gutenberg block
  19. Testing custom themes / plugins under Gutenberg
  20. Gutenberg LinkControl suggestionsQuery not working
  21. Gutenberg – How to prevent block from being deleted and reordered/moved
  22. WordPress Gutenberg Columns block
  23. Is it possible to bulk migrate all deprecated instances of a gutenberg block?
  24. How to Add a Container Class to Standard Gutenberg Blocks
  25. How to display InnerBlocks in render callback
  26. How to check if post has Video or Gallery block in Gutenberg blocks?
  27. Gutenberg – button to parse and format all blocks?
  28. Custom WP Block using Inner Blocks crashes editor, doesn’t save content
  29. Gutenberg Button Border Radius Default
  30. Disable title block on edit screen for a custom post type
  31. Gutenberg: Block validation fails if editor is reloaded or post is edited. data.getBlocks(); is empty in save function
  32. Delete a Gutenberg Block Programmatically?
  33. Can Gutenberg be used as an editor on a page?
  34. Import external data into post using custom Gutenberg block
  35. How do a I add an attribute to element (when using block theme)?
  36. How to transform block variant to default version?
  37. How can I add a color picker to a custom Gutenberg block which includes the default system palette from theme.json?
  38. How to makes Custom Post Type posts as Gutenberg’s patterns?
  39. Can’t run WP e2e-test-utils because the browser exits on login?
  40. Modify the InnerBlocks ‘Add block’ block appender label
  41. Do I need wp-tinymce-js?
  42. wp_schedule_single_event issue with save_post hook in gutenberg
  43. Gutenberg TextareaControl escapes html
  44. Block editor fails to update HTML section when the word “from” is in source code
  45. Gutenberg extending the existing class
  46. Creating Block templates with ‘core/heading’ other than level 2
  47. how to trigger a Gutenberg image gallery lightbox
  48. Remove or rename “Default” from Gutenberg typography settings
  49. How to put and components inside in Gutenberg block
  50. Wp-script package stop to work
  51. CheckboxControl does not visible change
  52. How to import Reusable Blocks programatically?
  53. Remove formatting in rich text with Gutenbergs Block editor
  54. Setting font sizes in theme.json
  55. Is it possible to disable font sizes on sub blocks only?
  56. Get selected block every time a new block is selected in Gutenberg
  57. How do I include and iframe in a Custom Block?
  58. Gutenberg InnerBlocks with ACF Blocks – How to enable multiple buttons?
  59. How to work with multilingual sites using the full site editor and block themes?
  60. Trying to edit a page returns the editor encountered an unexpected error
  61. Block patterns: Any way to reset the pattern to whatever is in the code?
  62. Block variation / Variation API scope “transform”
  63. Is there a function to “blockify” html?
  64. Custom style css doesn’t work in Gutenberg preview
  65. Gutenberg get list of all custom image sizes
  66. How to set a template part area?
  67. Upgraded to wordpress 5.7 and now I can’t select myself as a post author
  68. Stop JSON code from injecting into gutenburg classic block
  69. Extend the “Convert to Blocks” feature to add additional functionality
  70. Blocks. How to store default settings?
  71. Gutenberg/WordPress – Limit number of categories
  72. Block editor not displaying properly
  73. Can the Gutenberg editor be toggled closed?
  74. Guenberg Block Not Saving – When additional div added
  75. How to open WordPress media create/edit Gallery Dialog
  76. Pages are editable in Gutenberg, but posts are coming up in classic editor
  77. WordPress custom block compatability with WPML
  78. Add a button to the Gutenberg editor header
  79. Disabling gutenbeg slow down post saving
  80. How to solve react dom ‘removeChild’ on Node error while google translate extension is on and selecting any core block [closed]
  81. Is it possible to consume context from a parent block and update it from within a child block?
  82. Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined
  83. WordPress “HTML editor” which doesn’t trash hand-coded HTML?
  84. How to force package.json to create build some files?
  85. How to modify array of object in Gutenberg (block/editor)?
  86. fetch more than 100 records in block editor API call
  87. How can I deprecate an old version of my custom Gutenberg block, but keep the new version?
  88. register_block_type – no block available in block editor
  89. Full Site Editing (FSE) – How do I display no results with wp:query?
  90. Categories, tags and thumbnails panels are not visible in the Block editor’s post menu
  91. How to translate multiple blocks within one plugin
  92. How to disable the Code Editor in Gutenberg?
  93. Enable Gutenberg Editor when editing tags
  94. How to position more than one item over an image in a Gutenberg WordPress block theme
  95. Some CSS classes missing when rendering the page with get_the_content()
  96. Error with RichText Component
  97. Rem font size is different in the frontend and block editor
  98. Add to Media Inserter Categories
  99. Get attributes from last block created
  100. How do I make the block editor use https by default?
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

  • Disable image compression for WebP
  • At what stage does wp_ajax hooks gets applied during WordPress request?
  • How to create specific wordpress Table
  • How to get variable from other function inside class function using add_action for Ajax call
  • Some images not loading after changing IP on local wordpress install
  • search posts by POST ID
  • Elementor Contact Form Submit button has empty class
  • Duplicate Slugs on multilingual site (with Polylang)
  • Timeline from diferent wordpress api urls endpoint works, but diferent date
  • $attributes not defined in block.json PHP template for ACF blocks
© 2023 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