WPIntell

Source evidence

Create a dynamic counter

Jellyfish Counter Widget · support · 2023-09-28T08:47:00+00:00

complaintsentiment
mediumseverity
0.81relevance
1replies
Evidence linked to opportunitycommercial context

Proof Health

Open evidence

Commercial opportunities need traceable source links before they are treated as build-worthy.

4 / 27 rows with source links

14.8% of this page's analysis has direct source links.

0 build-decision rows missing links

0 rows here require auditable proof before promotion.

23 rows with no attached evidence

0 rows have source counts but still need direct links.

Conversation

support
ruthkl unresolved
Hi, I would like to show in a counter the number of years of the institution I am building a web page for. How can I do that? Do I have to use java script combined with the code? Can you show me an example of how to implement it? Hi, I found out how to pass dynamic values as parameters to a shortcode. In my functions.php I created an own shortcode with an attribute $date_of_birth. Then I calculate the age, and pass it on to the real counter shortcode using do_shortcode(). function age_counter_shortcode($atts) { extract( shortcode_atts( array( 'date_of_birth' => '01.01.2000', ), $atts ) ); $counter_value = (date('Y') - date('Y',strtotime($date_of_birth))); return do_shortcode("[jellyfish_counter end='{$counter_value}']"); } add_shortcode('age_counter', 'age_counter_shortcode'); This reply was modified 2 years, 8 months ago by ruthkl .

Comments

1 shown
ruthkl 2023-09-29T09:33:00+00:00

Hi, I found out how to pass dynamic values as parameters to a shortcode. In my functions.php I created an own shortcode with an attribute $date_of_birth. Then I calculate the age, and pass it on to the real counter shortcode using do_shortcode(). function age_counter_shortcode($atts) { extract( shortcode_atts( array( 'date_of_birth' => '01.01.2000', ), $atts ) ); $counter_value = (date('Y') - date('Y',strtotime($date_of_birth))); return do_shortcode("[jellyfish_counter end='{$counter_value}']"); } add_shortcode('age_counter', 'age_counter_shortcode'); This reply was modified 2 years, 8 months ago by ruthkl .