admin管理员组文章数量:1417442
when i go to wp customizer then i want edit the name popular and cat_id =21
<div class="p_list"><h2><span>popular</span></h2>
<?php $first = true; ?> <?php $cat_id = 21;
$latest_cat_post = new WP_Query( array('posts_per_page' => 4, 'category__in' => array($cat_id)));
if( $latest_cat_post->have_posts() ) : while( $latest_cat_post->have_posts() ) : $latest_cat_post->the_post(); ?>
when i go to wp customizer then i want edit the name popular and cat_id =21
<div class="p_list"><h2><span>popular</span></h2>
<?php $first = true; ?> <?php $cat_id = 21;
$latest_cat_post = new WP_Query( array('posts_per_page' => 4, 'category__in' => array($cat_id)));
if( $latest_cat_post->have_posts() ) : while( $latest_cat_post->have_posts() ) : $latest_cat_post->the_post(); ?>
Share
Improve this question
edited Aug 6, 2019 at 21:35
abdullahsk
asked Aug 6, 2019 at 20:43
abdullahskabdullahsk
12 bronze badges
1
|
1 Answer
Reset to default -1The customizer, as it is mostly for style settings.
If you want to make a heading dynamic then you could create a custom field. Then echo that into the page or post template using the get_post_meta function, and wrap it in whatever HTML tags you wish.
Hope this helps!
check these out:
https://wordpress/support/article/custom-fields/
https://wordpress/support/article/custom-fields/#displaying-custom-fields
Or you could try these plugins:
https://wordpress/plugins/meta-box/
https://wordpress/plugins/advanced-custom-fields/
本文标签: codexhow do i add customizer edit option without plugin in wp
版权声明:本文标题:codex - how do i add customizer edit option without plugin in wp 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745263911a2650482.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
functions.php
. Your site won't be any faster though, you'll have just made it more complicated. Otherwise I'm not sure I understand your question, can you reword it? Also can you reformat your code? It's very difficult to read, and has no indentation, all the PHP is on a single line – Tom J Nowell ♦ Commented Aug 6, 2019 at 21:14