Using variable as shortcode parameter

The shortcode function behind that shortcode will need to be able to accept an argument so it can return your variable in the expected place. If this is a custom shortcode function you wrote, you’ll have to make that adjustment. If its a third party shortcode, you’ll need to look at their documentation and see … Read more

Trying to insert a div ID link into Woocommerce shortcode Pagination

A certain chatty AI found me a solution. add_action( ‘wp_footer’, ‘custom_pagination_script’ ); function custom_pagination_script() { ?> <script type=”text/javascript”> jQuery( document ).ready( function( $ ) { $( ‘.page-numbers a’ ).click( function( event ) { event.preventDefault(); var link = $( this ).attr( ‘href’ ); window.location = link + ‘#d3c-psf-products’; } ); } ); </script> <?php } add_action( … Read more

How call WordPress shortcode inside function file

I need echo do_shortcode(‘[Shortcode]’); to go where it says “New Item Contents here!” is there any way to do this? Just put it there: add_action( ‘woocommerce_account_new-item_endpoint’, ‘add_new_item_content’ ); /** * Add content to the new tab. * * @return string. */ function add_new_item_content() { echo do_shortcode(‘[Shortcode]’); } Maybe I’m misunderstanding the question, but that’s all … Read more

Custom plugin with shortcode not working

add_shortcode(‘myCustomShortcode’, ‘this_particular_function’); As soon as I looked at my code this morning I realized I was trying to pass the function name ([this_particular_function]) as the shortcode, not the shortcode name ([myCustomShortcode]). I overlooked this SO many times yesterday trying to look for some complex answer! I am smacking my head on the desk. Everything works … Read more

Undefined Function Fatal Error with Shortcode [closed]

Well, the AI didn’t do THAT bad of a job. But either you or the AI didn’t deliver code for the functions get_users_who_commented or get_number_of_comments_by_user which are not wordpress functions but have to be coded seperatly. Also, i would change the code a bit to use wordpress-internal functions like the comment query: function my_custom_shortcode( $atts … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)