Skip to main content
Share Your Experience: Take the 2024 Developer Survey

New answers tagged

1 vote
Accepted

Calling a function via a shortcode in javascript

I'm afraid the code you've shared is rather wonky and there isn't just one thing that is backwards. Here are the first few things that came into my mind. add_filter( 'learn-press/after-content-item-...
Antti Koskinen's user avatar
0 votes

Unique ID for WordPress shortcodes when used more than once on a page?

Just start a global variable and increase it everytime the shortcode is called. $shortcode_count = 0; add_shortcode('count_example', 'count_example_shortcode'); function count_example_shortcode( $...
Simon's user avatar
  • 145
1 vote

Adding a css class to the gallery

If you look at the gallery shortcode you will see that you are using the wrong filter. With post_gallery you can override the complete html of the shortcode. Your code performs a str_replace on an ...
cjbj's user avatar
  • 14.6k

Top 50 recent answers are included