'Wordpress Parameter background change

Afternoon all

I never use wordpress. I am looking for a simplest solution for the following:

I have a wordpress site.

for a param e.g website.com/cars.... I want to change the background of the site to a car related background

for a param e.g website.com/boats.... I want to change the background of the site to a boat related background

Ideally would like to get this to 100s of backgrounds.

I have no idea in the wordpress world if there is a plugin or what the best practice is for something like this.

Before I start I am all open to ideas

Thanks all



Solution 1:[1]

I would suggest to go something like this:

For eg: page url : website.com/cars slug : cars

Here I would suggest you to keep the name of image as : cars.png/jpg and in setting up the image :

$postId = get_the_ID();
        $slug = basename(get_permalink($postId));
        echo $slug;

once you get the $slug value use it as a "path+$slug.png/jpg"

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Dharman