plugins - Any method to make specific widget for every post and page?

is here any method , that can make specific widget for each post and page? I mean, for example here is widget html:<d

is here any method , that can make specific widget for each post and page? I mean, for example here is widget html:

<div id="heatmapthemead-secondary-sidebar-container" role="complementary">
<h4 class="widget-title">bla bla bla </p></div></div>

But can i make different text here for every page and posts? Any help of function.php ? For example for Post 1 it should show NEw york for post 2 washington and so on. Different widget for all posts?

is here any method , that can make specific widget for each post and page? I mean, for example here is widget html:

<div id="heatmapthemead-secondary-sidebar-container" role="complementary">
<h4 class="widget-title">bla bla bla </p></div></div>

But can i make different text here for every page and posts? Any help of function.php ? For example for Post 1 it should show NEw york for post 2 washington and so on. Different widget for all posts?

Share Improve this question asked Jan 25, 2018 at 15:53 ნიკა ხაჩიძენიკა ხაჩიძე 891 gold badge3 silver badges7 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

You should be able to do what you want with the Category Country Aware (CCA) Plugin. (it's for use within post/page content but also includes the widget below).

Option 1: (only for posts and if you are happy to create one off categories):

  • Create new categories for say "Washington" and "NY" via WP Admin Dashboard -> posts -> categories.
  • In the post editor associate each post with the relevant new category.
  • Add an entry (text, HTML, JavaScript) with specific content for "NY" to the CCA widget, save then repeat for "Washington" etc (example below).

.
You can use multiple CCA widgets ("text" or "RSS"), so you could use a second widget to say display local news for that city.

Option 2: If you want it to work with pages, or don't want give posts an extra unique category, want to use shortcodes, or would like to use the widget as a canvas for your own PHP then:

  • Additionally install this (free) Extension to the Category Country Plugin

You can then add a custom field cca_category and value (e.g "Washington") to your posts and pages. The CCA widget will check if the post has a matching "cca_category" before checking for a matching WordPress category. (Section 4 of above link provides details on how to do this).

Declaration of interest! : I'm the plugin author.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745154778a4614050.html

相关推荐

  • plugins - Any method to make specific widget for every post and page?

    is here any method , that can make specific widget for each post and page? I mean, for example here is widget html:<d

    2小时前
    10

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信