Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Different theme/html for every page?
#1
This is one of the best and simple CMS I discovered! 
My question: Is it possible to give every page a different background color or even a complete new theme? I really like the possibility to edit the html but unfortunately I didn't saw an option to do that seperetaly for every page. 
Thank you!
Reply
#2
(2018-04-30, 13:09:31)gsmoel Wrote: This is one of the best and simple CMS I discovered! 
My question: Is it possible to give every page a different background color or even a complete new theme? I really like the possibility to edit the html but unfortunately I didn't saw an option to do that seperetaly for every page. 
Thank you!

First install the addons i18n and i18n custom fields. Then you define a custom field named "backgroundcolor". Now you'll find in the "page options+" on "edit page" a field in which you type in the wanted background-color - e.g. red, #ff0000, rgb(255,0,0).

In your template write in the <head>-section this
Code:
<style>
body { background-color: get_custom_field('backgroundcolor'); ?>
</style>

Alex
Reply
#3
You can also use components if you plan on having a few or want to do dynamic code driven code.
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#4
(2018-04-30, 18:36:24)Alexander_ Wrote:
(2018-04-30, 13:09:31)gsmoel Wrote: This is one of the best and simple CMS I discovered! 
My question: Is it possible to give every page a different background color or even a complete new theme? I really like the possibility to edit the html but unfortunately I didn't saw an option to do that seperetaly for every page. 
Thank you!

First install the addons i18n and i18n custom fields. Then you define a custom field named "backgroundcolor". Now you'll find in the "page options+" on "edit page" a field in which you type in the wanted background-color - e.g. red, #ff0000, rgb(255,0,0).

In your template write in the <head>-section this
Code:
<style>
body { background-color: get_custom_field('backgroundcolor'); ?>
</style>

Alex

Thanks for reply Alex, I did everything you said but it didn't work. Do I have to do something else like different type customfield? I chose textfield... Or is it overwritten by the default css file of the theme? Please help me Thank you!
Reply
#5
Code:
<style>
body { background-color: <?php get_custom_field('backgroundcolor'); ?>;}
</style>
Reply
#6
The other "traditional" way that I see no one mentioned is having several templates in the theme.

- You make a copy of template.php to, say, template2.php
- Edit template2.php and make changes (insert your custom background css or whatever)
- Edit the page in which you want to change the background color and select template2.php instead of the default template.
Reply




Users browsing this thread: 2 Guest(s)