How do I integrate a codepen?

All sorted. My theme actually had a section for custom javascript in the theme options. I added the code there and used the enqueue for the bootstrap – all working fine now.

Javascript / PHP – closing the loop

Perhaps you could either use admin ajax or the WP REST API to send a request to the server for the user meta update. If you have a look at the WP documentation (links above) or similar questions here on WPSE, you can find examples on how to do it. Update user meta with ajax … Read more

VisualComposer/WPBakery Page Editor: Is any JS event triggered after the Edition pop-in is shown?

Solution: add an action on the tag vc_edit_form_fields_after_render. add_action( ‘vc_edit_form_fields_after_render’, function() { echo ‘<script src=”‘ . AN_URL . ‘test.js”></script>’; // Or something other }, 9 ); In the functions.php or equivalent. (Indeed, the tag vc_edit_form_fields_after_render is used by do_action( ‘vc_edit_form_fields_after_render’ ) which is located in js_composer\include\classes\editors\class-vc-edit-form-fields.php . So what you type in your add_action callable … Read more

Append php file to footer

This might help you. add_action(‘wp_footer’, ‘insert_my_js_to_footer’); function insert_my_js_to_footer(){ ?> <script> // your script here. </script> <?php }; UPDATE: And if you want to append the php file itself then you can try this. add_action(‘wp_footer’, ‘insert_php_file_to_footer’); function insert_php_file_to_footer(){ include( ‘your-php-file.php’ ); };

Homepage Menu Link Won’t Function

This function in /themes/lucid-press-child/js/custom-js.js is your problem. function homepageNavigationClasses(){ if(jQuery(‘body.home’).length){ //jQuery(‘#navigation a’).not(‘.sub-menu a’).click(function(event){ jQuery(‘#navigation a’).click(function(event){ var clickedLink = jQuery(this).text(); clickedLink = clickedLink.replace(/\s/g,”); if(!jQuery(this).parent().hasClass(‘page’)){ event.preventDefault(); //console.log(clickedLink); jQuery(‘html, body’).animate({ scrollTop: jQuery(“#”+clickedLink).offset().top – 400 }, 500); jQuery(‘#navigation li’).removeClass(‘active-hp-section’); jQuery(this).parent().addClass(‘active-hp-section’); } }); } } It’s looking for a ID to scroll the page too but it doesn’t have one … Read more

Show subcategory name selected in specific category woocoommerce

To display only assigned category you need to change hide_empty to true. Please see the modified code: $args = array( ‘hierarchical’ => 1, ‘show_option_none’ => ”, ‘hide_empty’ => true, ‘parent’ => 134, ‘taxonomy’ => ‘product_cat’ ); $subcats = get_categories($args); echo ‘<ul class=”wooc_sclist”>’; foreach ($subcats as $sc) { $link = get_term_link( $sc->slug, $sc->taxonomy ); echo ‘<li><a … Read more