[Support request] Missing border on

Home Forums Support [Support request] Missing border on

Home Forums Support Missing border on

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #917439
    wtm

    Hi, I was able to add modified date to my header element, however I lost the border that was showing. I originally used this code example #2 (https://docs.generatepress.com/article/page-hero-examples/). Thanks in advance!

    Header element code:

    <h1>{{post_title}}</h1>
    [page_hero_gravatar] {{post_author}} [modified_date]

    CSS:

    .posted-on .updated {
    border-left: 2px solid #fff;
    padding-left: 10px;
    margin-left: 10px;
    }

    .posted-on .updated {
    display: inline-block;
    }

    .posted-on .updated + .entry-date {
    display: none;
    }

    .posted-on .updated:before {
    content: “Updated: “;
    }

    PHP:

    function post_modified_date() {
    return get_the_modified_date();
    }
    add_shortcode( ‘modified_date’, ‘post_modified_date’ );

    #917556
    David
    Staff
    Customer Support

    Hi there,

    do you mean the | between the author and the date?

    If so you can simply add that to your Header Element content as HTML like so:

    [page_hero_gravatar] {{post_author}} | [modified_date]

    #917840
    wtm

    Thanks, I was able to get that to work, but I still loose the CSS function to add spacing:

    .posted-on .updated {
    border-left: 2px solid #fff;
    padding-left: 10px;
    margin-left: 10px;
    }

    Is it possible to keep this CSS for the border and padding?

    Also, how to show “Updated:” left of the date?

    .posted-on .updated:before {
    content: “Updated: “;
    }

    So as a result I want it to look like this:

    author name | Updated: updated date

    #917950
    Tom
    Lead Developer
    Lead Developer

    Try this instead:

    [page_hero_gravatar] {{post_author}} | [modified_date]

    Then you can do this:

    .hero-modified-date:before {
        content: "Updated: ";
    }
    #918037
    wtm

    Thanks for the quick reply, unfortunately that didn’t seem to do the trick. Here is what I have, let me know if I’m off with something:

    Element code:

    [page_hero_gravatar] {{post_author}} | [modified_date]

    CSS:

    .entry-date {
    border-left: 2px solid #fff;
    padding-left: 10px;
    margin-left: 10px;
    }

    .posted-on .updated {
    display: inline-block;
    }

    .posted-on .updated + .entry-date {
    display: none;
    }

    .hero-modified-date:before {
    content: “Updated: “;
    }

    PHP:

    function post_modified_date() {
    return get_the_modified_date();
    }
    add_shortcode( ‘modified_date’, ‘post_modified_date’ );

    Thanks!

    #918563
    David
    Staff
    Customer Support

    Why not just add the word to the header element eg.:

    [page_hero_gravatar] {{post_author}} | Updated: [modified_date]

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