Homepage Forums Dev & Debugging Page specific style in WordPress.

  • Page specific style in WordPress.

     Satya Mukherjee updated 7 months ago 2 Members · 2 Posts
  • Nellie Stracke

    Member
    December 22, 2020 at 11:12 pm
    15 Coins
    0 Gems
    Level: Rookie

    NOT USING ANY BUILDER

    I do not wish to use any page builders but few pages need specific styles. How can I achieve this using PHP+CSS?

    Ty.

  • Satya Mukherjee

    Administrator
    December 23, 2020 at 11:15 am
    8836 Coins
    484 Gems
    Helpful
    Up
    0
    Down
    Not Helpful

    You can do this using PHP. Paste the following code in your WordPress theme’s function.php

    Note: It is advised to use a child theme to make sure updates do not affect your changes.

    if(basename($_SERVER['REQUEST_URI']) == 'customurl')
    { ?>
    <style>
    //style goes here
    </style>
    <?php }

    Change the ‘customurl’ with your required url for example ‘samplepage’

Log in to reply.

Original Post
0 of 0 posts June 2018
Now

New Report

Close