[Support request] Style Hook Element

Home Forums Support Style Hook Element

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1111040
    Sonja

    I have made a shortcut, which display the date. Then i have put this shortcut in a inside_secondary_navigation hook. Now i want to style this element, so that it shows in white color in specific font size and left in the second nav bar. How to do that?

    I can not link to the site, because it is a closed dev site.

    #1111329
    David
    Staff
    Customer Support

    Hi there,

    can you show us your shortcode code? There maybe a CSS class within the HTML it outputs to use for styling, if not we can add one.

    #1111335
    Sonja

    In the Hook, the shortcode is: [footer_date]

    I made this shortcode with this snippet:

    add_shortcode( 'footer_date', 'lh_footer_date' );
    function lh_footer_date() {
        ob_start();
        echo date_i18n ('j. F Y');
        return ob_get_clean();
    }
    #1111356
    David
    Staff
    Customer Support

    Change this line:

    echo date_i18n ('j. F Y');

    to:

    echo '<span class="custom-date">' . date_i18n ('j. F Y') . '</span>';

    You can then style the date like so:

    .custom-date {
        font-size: 18px;
        color: #fff;
    }
    #1111357
    Sonja

    The problem is, that the date is displayed above the navigation. But it should be beside it.

    #1111371
    Leo
    Staff
    Customer Support

    We will need to see the site in order to tweak the CSS.

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