cURL error 6 on news area, and also won’t auto update

I had the same problem and eventually found a solution today (actually, a friend of mine did it). What I did was to edit the /etc/nginx/nginx.conf file and add resolver ip address. The configuration file in the section server contains now resolver 127.0.0.1; below you can find a part of it server { listen 443 … Read more

How can I display Custom Post type Custom Columns and its Content in a Dashboard Widget?

To answer your specific question: no, there are no hooks that would allow you to “reuse”. However, there is nothing keeping you from calling your browseCustomColumns() function in your function that renders the dashboard widget. However, in order to do that, you’d have to make a minor change your compile_dashboard_widget() function: public function compile_dashboard_widget () … Read more

Do not replicate items if they exists in a foreach loop

Just set a flag to check for a new value, and only display the date if the new value does not match the flag, like so: <?php $args = array( ‘post_type’ => ‘tv-schedule’, ‘posts_per_page’ => -1, ‘orderby’ => ‘date’, ‘order’ => ‘ASC’, ‘post_status’ => array(‘publish’, ‘future’), ); $posts_array = query_posts($args); $flag = ”; // set … Read more

Action Hook Inside WordPress Plugin Shortcode

It’s not entirely clear what your ultimate goal is, but a simple way to catch a form submission is to hook init and check if something is set: function wpd_check_post_vars(){ if( isset( $_POST[‘first_name’] ) ){ // do something } } add_action( ‘init’, ‘wpd_check_post_vars’ ); There’s no connection here between the action and your Shortcode, it’s … Read more

How to add/change (woocommerce) product tab icon

It seems that these icons are just added with a CSS ::before selector. So if you have something like that to set up your custom tab: function woocommerce_product_write_panel_tabs(){ ?> <li class=”custom_tab”> <a href=”#custom_tab_data_mytab”> <?php _e(‘My Custom Tab’, ‘textdomain’); ?> </a> </li> <?php } Than you should be able to style the a::before with something like … Read more

How to add post thumbnail dynamically using Jquery?

js (edit 4) $(function() { $(‘body’).on(‘click’, ‘.post-link’, function() { // Jquery var ajax = {}; ajax.id= $(this).attr(‘rel’); var ajaxurl=”/wp-admin/admin-ajax.php”; jQuery.post( ajaxurl, { ‘action’: ‘get_img_post_and_title’, ‘data’: ajax }, function(response){ // add html if(response.success){ $(‘#post-cont’).append(“<li>ID: “+response.data.post_id+” “+response.data.post_title+” <img src=””+response.data.post_thumb+””/> –<a href=”#” class=”close”>X</a></li>”); } } ); }); }); php (edit 4) // php add_action(“wp_ajax_get_img_post_and_title”, “get_img_post_and_title”); add_action(“wp_ajax_nopriv_get_img_post_and_title”, “get_img_post_and_title”); function … Read more

Display posts belonging to child term

I was able to get this working with the following code. I used the relation operator AND, referenced the var ($this_term) that contained get_queried_object(); to set the taxonomy in the tax_query and adjusted the term field in the tax_query. $this_term = get_queried_object(); $args = array( ‘parent’ => $this_term->term_id, ‘orderby’ => ‘slug’, ‘hide_empty’ => false ); … Read more