Categories
CMS Mastering Development Wordpress

Uploading a media item with the wp-json API to a specific path

I’m using the WP-JSON API to import all my posts from my live site to my development site. It’s working fine for posts, categories and authors, but when I upload my images, the API treats the files as having been uploaded that day (so for example, as we’re in June 2020, the files all go […]

Categories
Mastering Development

Issue to send data to the database

I wrote the code below, but it give me several errors (listed after the code). I didn’t know how to solve it. Model -> News_model <?php class News_model extends CI_Model { public function __construct() { $this->load->database(); } public function get_news($slug = FALSE) { if ($slug === FALSE) { $query = $this->db->get(‘news’); return $query->result_array(); } $query […]

Categories
Development

Nodejs Express : Cannot read property ‘image’ of null and unhandled error event

I have tried to find out where the wrong is. can anyone please help for this one . if I try to submit the post without an image, this error comes up instead of a flash message: and source code link: https://github.com/rizvi770/cart.git TypeError: Cannot read property ‘image’ of null at /Users/rizvi/Desktop/cart/routes/admin_products.js:115:37 at Layer.handle [as handle_request] […]

Categories
Development Laravel

How to solve failure name image on seed using faker Laravel 6

I create a table , this table named book I create a seeder to add data on the table, this table has a query like this. public function run() { $books = []; $faker = Faker\Factory::create(); $image_categories = [‘abstract’, ‘animals’, ‘business’, ‘cats’, ‘city’, ‘food’, ‘nature’, ‘technics’, ‘transport’]; for($i=0;$i<25;$i++){ $title = $faker->sentence(mt_rand(3, 6)); $title = str_replace(‘.’, […]

Categories
Development Laravel

How to solve failure name image on seed using faker Laravel 6

I create table ,this table named book i create a seeder to add data on table , this table have query like this. public function run() { $books = []; $faker = Faker\Factory::create(); $image_categories = [‘abstract’, ‘animals’, ‘business’, ‘cats’, ‘city’, ‘food’, ‘nature’, ‘technics’, ‘transport’]; for($i=0;$i<25;$i++){ $title = $faker->sentence(mt_rand(3, 6)); $title = str_replace(‘.’, ”, $title); $slug […]

Categories
Development

Codeigniter 3 blogging application bug: post slug updates even if there are no changes to the post’s title

I am working on a basic blog application with Codeigniter 3.1.8 and Bootstrap 4. For this application, the posts are uniquely identified by slug and displayed to the viewers. I have created a mechanism that prevents duplicate slugs in case there are duplicate post titles, by adding numbers to the slugs. This mechanism is included […]