Customizer: get_preview_url() inside customize_save_after hook

I managed to do it via JS, it does exactly the same thing at the time I want it to: wp.customize.bind( ‘saved’, function( d ){ $.ajax({ url: ajaxurl, type: ‘post’, dataType: ‘json’, data: { action: ‘actionName’, url: wp.customize.previewer.previewUrl() } }); }); I can then use the preview URL in an ajax action function. Don’t forget … Read more

Theme folder doesnt exist

I’m giving possible cases from the top of my head: Case 1: May be it’s related to realpath() function. realpath() acts differently in different OS. Also, it returns false if the web server user doesn’t have executable permission on the corresponding directory. There are some other problems too, so better try this: // change it … Read more

Need help understanding this WP Query [closed]

You can try this code to show only post. if(isset($xt_corporate_lite_opt[‘xt_about_page’]) && $xt_corporate_lite_opt[‘xt_about_page’] != ”) { $args = array( ‘post_type’ => ‘post’); $xt_query = new WP_Query($args); if ($xt_query->have_posts()) { while ($xt_query->have_posts()) { $xt_query->the_post(); the_content(); } } wp_reset_postdata(); } if you have any doubt in WP_Query. then you could check this link in detail. https://codex.wordpress.org/Class_Reference/WP_Query

Create a simple Testimonial page

I would suggest a custom post type for your Testimonials. Each will be created as an individual post and you will have the ability to query, sort, categorize, your testimonials just as you can with blog posts, or any other post type. Non-technical site admins can simply “add new testimonial” and edit existing, etc, just … Read more

How To Show Different Footers For Different Post Types Pages?

You can use is_singular() instead. According to Codex, you can use this function the following way: is_singular($post_type); Then you can print your desired code into footer the following way: function my_footer_code() { if ( is_singular(‘my-post-type’) ){ //Your code here } } add_action(‘wp_footer’,’my_footer_code’);

Licensing options for WordPress Plugins

This is a legal and business question and not a technical one, but since you found an angle that is slightly relevant to plugin development, here comes an answer. Copyright law is complex and while in many places it is basically the same, there are still differences between different countries and therefor there is no … Read more