Wordpress adding feature image link rest api
Go to appearence to theme editor find function.php
add_action('rest_api_init', 'register_rest_images' );
function register_rest_images(){
register_rest_field( array('post'),
'fimg_url',
array(
'get_callback' => 'get_rest_featured_image',
'update_callback' => null,
'schema' => null,
)
);
}
function get_rest_featured_image( $object, $field_name, $request ) {
if( $object['featured_media'] ){
$img = wp_get_attachment_image_src( $object['featured_media'], 'app-thumb' );
return $img[0];
}
return false;
}
301 redirect using wordpress plugin
I've had an issue when I need to change domain but I want to keep my links and don't want to duplicate content (been there pinguin) So I've tried few plugins but it seems that the only plugins that works for me is a plugin call redirection.
Fixing insert media HTTP error Wordpress
Make an .htaccess file in wp-admin, paste this line :
<IfModule mod_security.c>
SecFilterEngine Off
SecFilterScanPOST Off
</IfModule>
define('WP_MEMORY_LIMIT', '64MB');