Archive with months of current year only

I left the plugin for what it was and finally figured it out with help of one of the answers in the other thread I’ve mentioned. The code below did what I needed. function get_posts_grouped_by_month( $year = null ) { if ( $year == null ) { $year = date(‘Y’); } $months = range(1,12); $posts … Read more

Woocommerce – Change Variable Product Add to Cart to behave like external product using Custom Field (link) [closed]

I was able to find the solution. This is so simple and I can’t believe I did not just do this first, but there you are (duh), I thought it was more complex than that… My solution is below: Copy woocommerce template to my theme to override single-product/add-to-cart/variable.php editing variables.php, change the <?php echo esc_url( … Read more

Call ajax on the frontend

Most of your code looks ok to me. Is your script loaded? (Verify by viewing page source). Per Milo’s suggestion, this is how to properly enqueue your plugin’s scripts: // Enqueue your scripts function load_my_scripts(){ wp_enqueue_script( ‘my-ajax-handle’, plugin_dir_url( __FILE__ ) . ‘myajax.js’, array( ‘jquery’ ) ); wp_localize_script( ‘my-ajax-handle’, ‘the_ajax_script’, array( ‘ajaxurl’ => admin_url( ‘admin-ajax.php’ ) … Read more

Installed Forca Theme, wonder how I can alter Post editing screen

It sounds like you want register_taxonomy_for_object_type to add the taxonomy to the “Page” post type. register_taxonomy_for_object_type(‘events-cat’,’page’); As noted, I don’t know how you expect this to work. You are going to have to alter the page templates. I would also suggest that you look into the Template Hierarchy, in particular the part about custom taxonomies. … Read more

get current page number with wp_link_pages()

wp_link_pages depends on four globals— $page, $numpages, $multipage, and $more. I cannot test this right now, but if I remember correctly $page is the current page and $numpages is the total number of pages. All you should need is: global $page; echo $page;

jQuery code didn’t run on my plugin

Check the DOM for the theboxjs.js and see if it is loaded correctly (check the output path). If not then you have path issues. Try using admin_enqueue_scripts instead of admin_init for loading scripts. You might also have conflict in your script. When writing scripts for WP try to avoid $ and use jQuery instead.