[Support request] Code block Title

Home Forums Support [Support request] Code block Title

Home Forums Support Code block Title

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #2371928
    Jatin

    Hi Guys,

    I have just visited a website which was using a Code block and prism.js for showing code block. The site is using Generatepress.

    I have provided a sample blog post of the site where the code block is being used.

    Code Block contains a Title. How to add a title to the code block.

    When i checked it in the site’s CSS its using something like below. How can i apply the same to my site please.

    .prism-titlename {
        margin: -16px -16px 24px -16px;
        padding: 4px 16px;
        font-weight: bold;
        color: #333;
        background-color: #eee;
    }
    #2371951
    Fernando
    Customer Support

    Hi Jatin,

    Try adding class code-block-title to the class list of the Heading Block, then add this in Appearance > Customize > Additional CSS:

    .code-block-title {
        margin-bottom: -10px;
        padding: 8px 16px;
        font-weight: bold;
        color: #333;
        background-color: #eee;
    }
    #2371958
    Jatin

    Added whats next ? How to add title ?
    I am using Prism.js and same has been in use in the other site as well.

    #2371962
    Fernando
    Customer Support

    Aren’t these the title for instance?: Powershell code to disable SSL 2.0

    Can you try adding the class to those Heading Blocks if so?

    #2371988
    Jatin

    No Thats just Headlines, Please check the site which I sent as an example. How that site is doing it ?

    #2371995
    Fernando
    Customer Support

    It’s most likely, added through the Code Editor manually. Example: https://share.getcloudapp.com/NQujpgZN

    The alternative, if you don’t want to alter the code is to add a Heading before the Code Block and give it the class I mentioned.

    Another Alternative would be to use GenerateBlocks Plugin for the titles – https://docs.generateblocks.com/article/headline-overview/

    #2372014
    Jatin

    Thanks

    #2372030
    Fernando
    Customer Support

    You’re welcome Jatin!

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.