IF condition based on wp_remote_get output

Following would be the revised example code which you may want to try. function display_api_response() { $api_url = “https://randletter2020.herokuapp.com”; $response = wp_remote_get($api_url); if ( 200 === wp_remote_retrieve_response_code($response) ) { $body = wp_remote_retrieve_body($response); if ( ‘a’ === $body ) { echo ‘A wins’; }else { // Do something else. } } } add_action( ‘init’, ‘display_api_response’ ); … Read more

“uagb/section and uagb/columns block”

UAGB refers to Ultimate Addons for Gutenberg, a plugin that creates custom blocks for Gutenberg, the block-editor. If you wish to use the uagb/section block (which uses both Gutenberg and UAGB), you’ll need to install and activate the Ultimate Addons for Gutenberg plugin. If you already have that plugin installed and activated and the error … Read more

disabling ftp on wordpress

Problem solved. Incorrect wordpress file permissions. Reset all wordpress files with sudo chown -R www-data:username wordpress sudo chmod 755 -R wordpress and the problem disappeared.

What are admin hooks

The init hook is triggered a little earlier than the admin_init. Between them is triggered wp_loaded and few hooks related to updating the DB. The init hook fires when WP is finished loading (viewer-facing and administration side). The admin_init hook fires on administration side only (/wp-admin/*), therefore is triggered also by front- and back-end ajax … Read more

List category posts displaying limited posts

It might be because of pagination. Check you /wp-admin settings. Also, try to set numberposts=-1. Source: https://github.com/picandocodigo/List-Category-Posts/wiki/More-parameters-you-can-use numberposts – Number of posts to return. Set to 0 to use the max number of posts per page. Set to -1 to remove the limit. Ex: [catlist name=mycategory numberposts=10] You can set the default number of posts … Read more