Home

Latest posts

Order Custom Post Type by custom Field with Types Plugin in WordPress

First you need to choose which post type you want to list and to choose a custom field to filter by you use the “meta_key” key in the array. The key starts with “wpcf-” and afterwards the name of the custom field you want to use. $posts = query_posts( array( ‘post_type’ => “event”, ‘posts_per_page’ => … Continue reading Order Custom Post Type by custom Field with Types Plugin in WordPress

How to put inline javascript in the footer of your page with WordPress

You can do this by adding this code to your template file. This will add a hook. Your javascript code will now be placed in the footer of your page (or where the wp_footer() function is called). <?php function footer_script(){ ?> <script> jQuery(document).ready(function(){ //put your js code here }) </script> <?php } add_action(‘wp_footer’, ‘footer_script’); ?> … Continue reading How to put inline javascript in the footer of your page with WordPress

Scrollto element with an id selector using jQuery

For example, if I have a button with an id “btn” and a form with the id “form” and I want to scrollto the form when I click on the button HTML: <p><a href=”” id=”btn”>go to form</a></p> <form id=”form”> </form>     jQuery: $(document).ready(function(){ $(“#btn”).click(function(e){ e.preventDefault(); $(‘html, body’).animate({ scrollTop: $(“#form”).offset().top }, 1000); }) })  

Tabindex problems with Gravity forms in WordPress

Sometimes there are problems with the tabindex when you use the Gravity forms plugin in WordPress. You can fix this by adding this to your theme’s functions.php file //############################################################################### // Fix Gravity Form Tabindex Conflicts //############################################################################### add_filter(“gform_tabindex”, “gform_tabindexer”); function gform_tabindexer() { $starting_index = 1000; // if you need a higher tabindex, update this number return … Continue reading Tabindex problems with Gravity forms in WordPress