WP_Remote_Get Not working

I have a plugin which uses wp_remote_get() and it’s not working on my nginx server so I decided to test this. I created a file called test.php and inserted: <?php $response = wp_remote_get( ‘http://www.domain.com/mytest.php’ ); print $response [‘body’]; ?> When I run this file I am getting error: 2017/02/04 16:22:31 [error] 16573#16573: *461100 FastCGI sent … Read more

Why is my Gutenberg block returning an error after initial save?

I created a Gutenberg block but after saving it and going back into the post I receive this error: This block contains unexpected or invalid content I couldn’t find any inconsistencies and I had a friend also take a look over to see if there was anything amiss. What am I doing wrong? registerBlockType(‘myblog/check-list’, { … Read more

Is there a theme function for is_password_protected()?

I’m looking at the function and template references and I’m not seeing a way to test for whether a post is protected. Is there a theme function for (something like) is_password_protected()? I’m already using add_filter( ‘the_password_form’, ‘custom_password_form’ ); to override the default form that shows up, but I want to customize some other aspects of … Read more

Enqueue Javascript Correctly for 3.5

I am trying to create tabs for admin settings page in wp, but I think I’m doing it wrong. The example below shows how I did it but I don’t know how to change this to use it correctly with no conflict ie. $. function my_plugin_load_js() { wp_deregister_script(‘jquery’); wp_register_script(‘jquery’, ‘http://code.jquery.com/jquery-1.8.3.js’); wp_enqueue_script(‘jquery’); wp_deregister_script(‘jquery-ui-core’); wp_register_script(‘jquery-ui-core’, ‘http://code.jquery.com/ui/1.9.2/jquery-ui.js’); wp_enqueue_script(‘jquery-ui-core’); … Read more

enqueue multiple Google fonts with multiple weights and styles (italic)

I am trying to enqueue multiple Google fonts with multiple weights (400,600,700, etc,) and styles (normal, italic) and can’t figure out why it is not working. This is the code that I am using in the functions.php: function load_fonts() { wp_register_style(‘googleFonts’, ‘http://fonts.googleapis.com/css?family=Dosis:400,600,700|Roboto:400,400italic,700,700italic’); wp_enqueue_style( ‘googleFonts’); } add_action(‘wp_print_styles’, ‘load_fonts’); This is the link that is being output … Read more

How to include all files within a folder to functions.php?

My functions.php includes other function files located within a ‘functions’ directory. Currently they’re individually added, in the format of this example: include(‘functions/login.php’); How can I modify this to include all files within the ‘functions’ directory, without listing them individually? 2 Answers 2 You can include/require all *.php files recursively using following function. foreach(glob(get_template_directory() . “/*.php”) … Read more