[SOLVED] Custom slug (url) for my posts aren't working in Simple Blog
Posted: Fri Jul 11, 2025 5:53 pm
Hello everyone.
I'm still dealing with the Simple Blog plugin which is what I needed the most to be working well. My website is live already (nobody is visiting yet), is about Recipes, is in Spanish but my admin dashboard still in English since I'm bilingual. Anywho... I would love to have my "posts" url being like this:
"mywebsitename.com/recetas/the-title-of-my-recipe" instead of "mywebsitename.com/post/the-title-of-my-recipe"
So, I've change class.SimpleBlog.php this way:
Unfortunately it doesn't work because, for some reason, the new posts are not saving correctly. I have checked the simpleblog.json and this what it's showing:
As you can see, the second POST have my title in Spanish, but all content is not saving at all. I would appreciate some little help on this please.
Thank you guys!
I'm still dealing with the Simple Blog plugin which is what I needed the most to be working well. My website is live already (nobody is visiting yet), is about Recipes, is in Spanish but my admin dashboard still in English since I'm bilingual. Anywho... I would love to have my "posts" url being like this:
"mywebsitename.com/recetas/the-title-of-my-recipe" instead of "mywebsitename.com/post/the-title-of-my-recipe"
So, I've change class.SimpleBlog.php this way:
Code: Select all
global $Wcms;
class SimpleBlog {
public $slug = 'recetas';
private $Wcms;
private $db;
private $dbPath;
private $dateFormat = 'd F Y';
private $path = [''];
private $active = false;
public function __construct($load) {
global $Wcms;
$this->dbPath = $Wcms->dataPath . '/simpleblog.json';
if ($load) {
$this->Wcms =&$Wcms;
}
}Code: Select all
{
"title": "Recetas",
"posts": {
"hello-world": {
"title": "Hello, World!",
"description": "This blog post and the first paragraph is the short snippet.",
"keywords": "#your, #keywords #here",
"date": 1752206742,
"body": "This is the full blog post content. Here's some more example text. Consectetur adipisicing elit. Quidem nesciunt voluptas tempore vero, porro reprehenderit cum provident eum sapiente voluptate veritatis, iure libero, fugiat iste soluta repellendus aliquid impedit alias."
},
"rellenos-de-coliflor-con-huevo": {
"title": "Rellenos de Coliflor con Huevo",
"description": "This blog post and the first paragraph is the short snippet.",
"keywords": "#your, #keywords #here",
"date": 1752206782,
"body": "This is the full blog post content. Here's some more example text. Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quidem nesciunt voluptas tempore vero, porro reprehenderit cum provident eum sapiente voluptate veritatis, iure libero, fugiat iste soluta repellendus aliquid impedit alias."
}
}
}
Thank you guys!