admin管理员组文章数量:1122846
I am creating a wordpress theme wth html and jquery. I want to add a data attribute to my pattern so that I can use jquery to control the behaviour. When I add a data attribute to my code, I get an error that an invalid property has been added. How do I fix this without using a plugin?
My pattern:
<?php
/**
* Title: Resume Layout
* Slug: portfolia/resume-default
* Categories: featured
*/
?>
<!-- wp:group {"metadata":{"categories":["featured"],"patternName":"portfolia/resume-default","name":"Resume Layout"},"className":"portfolia-resume-layout","layout":{"type":"flex","flexWrap":"nowrap","justifyContent":"center","verticalAlignment":"top"}} -->
<div class="wp-block-group portfolia-resume-layout">
<!-- wp:group {"className":"portfolia-sidebar"} -->
<div class="wp-block-group portfolia-sidebar">
<!-- wp:buttons {"layout":{"type":"flex","orientation":"vertical"}} -->
<div class="wp-block-buttons">
<!-- wp:button {"backgroundColor":"black","textColor":"white","className":"portfolia-sidebar-item active","style":{"elements":{"link":{"color":{"text":"var:preset|color|white"}}}}} -->
<div class="wp-block-button portfolia-sidebar-item active"><a
class="wp-block-button__link has-white-color has-black-background-color has-text-color has-background has-link-color wp-element-button">
本文标签:
How to add custom attributes to wordpress block theme
版权声明:本文标题:How to add custom attributes to wordpress block theme 内容由网友自发贡献,该文观点仅代表作者本人,
转载请联系作者并注明出处:http://www.betaflare.com/web/1736287586a1927912.html,
本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论