1. PROMO Upgrade to Pro Membership @ $99 / Lifetime & access all our 16+ premium Divi extensions: Divi Block, Carousel Toolkit, etc.LEARN MORE
Dismiss Notice
NEW Divi.Help Pro Carousel AI Toolkit - Magically turn your Divi design into carousel, simply by using our online toolkit. No plugins needed. Now it works with Divi 5 as well!Try our carousel AI toolkit
BEST Divi Block - A revolutionary drag & drop tool to easily mix & match 960+ premade blocks (Light & Dark) to kick start your Divi site design. Special module designs are included as well. Also newly added AI generator & color. Now it works with Divi 5 as well!
Learn More About Divi BlockFree Version ~ 340+ Free Blocks

Solved Custom post type CSS

Discussion in 'Free Divi Community Forum' started by Milos, Nov 9, 2021.

  1. Milos

    Milos New Member

    Hey,

    after implementing php code for custom post type, which works fine, and generating layout for it, custom css is not accepted.

    Is there any way to fix it?

    Tried with php code:

    function disable_cptdivi(){
    remove_action( 'wp_enqueue_scripts', 'et_divi_replace_stylesheet', 99999998 ); } add_action('init', 'disable_cptdivi');

    but no changes
     
    1. PRO MEMBER PERKS Divi Block Pro - Premade dynamic background hover design for your Divi site without using any plugins:View Demo
  2. Divi.Help

    Divi.Help Administrator
    Staff Member

    Not quite sure what you meant by custom css is not accepted. Any URL?
     
  3. Milos

    Milos New Member

    The solution was adding "body #page-container #et-boc" before each line. By custom css I mean Divi > Theme options > Custom css. And this css not works only for custom posts archive pages, detail pages. For rest of site it is fine, now it's overwriten

    for example:

    ul li a {
    padding: 0 } wasn't accepted

    adding:
    body #page-container #et-boc ul li a {padding: 0 } fixed problem

    But this isn't clean solution -.-'
     
    1. PRO MEMBER PERKS Divi.Help Pro Layout Packs - Agency Divi layout pack featuring modern overlay archive blog layout with hover effects:View Demo
  4. Divi.Help

    Divi.Help Administrator
    Staff Member

    Or perhaps you may just use !important tag for your CSS.
     
  5. Milos

    Milos New Member

    And after that, we lose hover options :)

    .et_pb_button {
    background: red!important;
    }

    .et_pb_button:hover {
    background: green!important;
    }

    But without adding !important (which is already added for some selectors) no changes

    So, solution was
    body #page-container #et-boc .et_pb_button {
    background: red;
    }
     
    1. PRO MEMBER PERKS Divi.Help Pro Layout Packs - Beautifully crafted Divi layout packs for you to kick start your Divi sites:View Demo