• Michel-G

    (@michel-g)


    Hello everyone,

    I am using Customirz theme, i would like to change the color of a spécial part of the pages.
    I have found how to change the colors for all my usual pages in th main-wrapper, but for pages who display articles by categories i would like to get a different color.
    I would like to use the section article-container for a different color, i was thinking about a function like that to change it in several pages :
    <?php
    add_action ( ‘main_wrapper’, ‘article_container’)
    Function change_background_color ( ) {
    if article id.section=(‘page-84’, ‘page-86’, “page-88”, “page-91”);{
    background-color: rgba(195, 250, 248, 0.70);
    }
    }
    but as i am not a strong user in PHP and CCS, it don’t work and makes my site fall down.
    https://demo.themesandco.com/two-columns-right-sidebar/
    I need really your help to go on with this great theme, as i am a newbee in wordpress i will have a lot of work to finish my site.
    Thanks so much for your help,
    cordially,

    Michel-G

Viewing 11 replies - 1 through 11 (of 11 total)
  • rdellconsulting

    (@rdellconsulting)

    Your php is invalid I’m afraid – back to the training manual ??

    Link to site?

    I’m sure there will be a css selector to achieve this.

    Thread Starter Michel-G

    (@michel-g)

    Hello rdellconsulting,

    thanks for your reply to me, i would like to give you the link to the site, it is an association site, the association is not yet available so i have not yet the right to show the site, this is the reason i gave the general theme link,I am sorry for this, in fact i have not change the general CCS code, may be i can give you the link in private ??
    thank’s for your help

    rdellconsulting

    (@rdellconsulting)

    Forum rules prevent me from soliciting direct contact I’m afraid.

    From the details above, try this:

    .page-84 .main-wrapper .article-container,
    .page-86 .main-wrapper .article-container,
    .page-88 .main-wrapper .article-container,
    .page-91 .main-wrapper .article-container {
    background-color: rgba(195, 250, 248, 0.70);
    }
    Thread Starter Michel-G

    (@michel-g)

    Ok thanks very much rdellconsulting,

    so for your code i don’t need anymore before ? or i need the begining i have build ?
    Like that …
    <?php
    add_action ( ‘main_wrapper’, ‘article_container’)
    Function change_background_color ( ) {

    thanks for your response ^_^

    rdellconsulting

    (@rdellconsulting)

    Sorry, I should have been clearer. Code above is CSS and should go in CustomCSS or a Child Theme style.css.

    Remove your other code which is php, and should be in CT functions.php

    Thread Starter Michel-G

    (@michel-g)

    Ok thanks so much rdellconsulting,

    very nice, you are very kind with me, i will have to learn more in the future about CCS and PHP, As the site will be finish and the association on activity ok i will show you all the work i have done on it to modify the appearance.

    Thanks so much, i will tell you soon how it works

    Cordially

    Michel-G

    Thread Starter Michel-G

    (@michel-g)

    actually it seem not working already, i have to moove, go to town …
    I will see as i come back home, we will find the solution, may be i forgot something important

    Thread Starter Michel-G

    (@michel-g)

    actually it seem not working already, i have to moove, go to town …
    I will see as i come back home, we will find the solution, may be i forgot something important

    Thread Starter Michel-G

    (@michel-g)

    Hello rdellconsulting, how are you ?
    I hope you spend a nice weekend,

    I was looking at the code with google chrome web development console,
    and if i add a class background-color to the part i want to modify, i found this in the element window of the page 84
    <div class=”container” role=”main”>
    <div class=”row column-content-wrapper”>
    <div id=”content” class=”span9 article-container” style=”background-color: aqua;”> (i took aqua for exemple of color)
    <article id=”page-84″ class=”post-84 page type-page status-publish hentry row-fluid”>
    <header class=”entry-header”>

    but how i can translate in CCS ?
    Thanks for your help, i think i am near the solution.

    rdellconsulting

    (@rdellconsulting)

    Various ways but the more specific code will target more exactly what you want.

    Given above, this would work:

    .post-84 .entry-header {
    background-color: red;
    }
    Thread Starter Michel-G

    (@michel-g)

    Hello rdellconsulting,

    Thank you so much for your help, your code put me on the right way,
    in fact, look :
    .post-84 {
    background-color: lightblue;
    }
    that enough … I have the bad mind to do complicate ??
    In fact i will do the same for all the 4 pages, and try with rgba colors
    because the first try don’t work.
    Ok not my speciel color works very well…
    That nice, thank you very much for your great help rdellconsulting
    have a nice sunday
    Michel

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Changing colors in pages main-wrapper’ is closed to new replies.