• Resolved whatevaitis

    (@whatevaitis)


    Hello all. I’m hoping another user can answer me here as I’ve hassled the theme author more than enough!

    I’m using a child theme for MH Magazine Lite.

    I wanted to make it so the post date on individual post pages doesn’t link to anything. This has been accomplished by adding the following code to my functions.php (thank you, MH themes for this!):

    if ( !function_exists( 'mh_magazine_lite_post_meta' ) ):
        function mh_magazine_lite_post_meta() {
            echo '<span class="entry-meta-date updated"><i class="fa fa-clock-o"></i>  ' . get_the_date() . '</span>' . "\n";
        }
    endif;
    add_action( 'mh_magazine_lite_post_meta' );

    The problem now is that the .entry-meta styling in my style.css file no longer has any effect. I had a dotted border above and below the date and I had control over the margins. Now the borders are gone and the date is crammed tightly between the page title and the content.

    Obviously, I’m not a coder. I just switched to a child theme and have been working to get everything back how I had it when I modified the main theme. This is the final piece of the puzzle. I’m probably missing something minor, but without knowing code, it’s a complete mystery to me.

    I did try editing my functions.php entry using the .entry-meta reference, but because I don’t know what I’m doing, my wild guesses just broke the site completely. Those experiments have been undone so I’m back to the functions.php code above.

    I’m reading up on this stuff but am still hopelessly lost on this.

    Thanks.

    • This topic was modified 7 years, 9 months ago by whatevaitis.
    • This topic was modified 7 years, 9 months ago by whatevaitis.
Viewing 7 replies - 1 through 7 (of 7 total)
  • Hi whatevaitis,

    thanks for using MH Magazine lite.

    The CSS doesn’t work anymore because you’ve removed too much code from the function. Just copy & paste the original function mh_magazine_lite_post_meta() from the parent theme into your child theme and then only remove the link for the date while leaving everything else intact.

    The correct code for the date without link can be found in your other thread.

    Thread Starter whatevaitis

    (@whatevaitis)

    Oh, thank you much!

    Thread Starter whatevaitis

    (@whatevaitis)

    I didn’t paste the entirety of the code originally – just the part about the date. Here’s what I have in my functions.php:

    if ( !function_exists( 'mh_magazine_lite_post_meta' ) ):
        function mh_magazine_lite_post_meta() {
            echo '<span class="entry-meta-date updated"><i class="fa fa-clock-o"></i> ' . get_the_date() . '</span>' . "\n";
        }
    endif;
    add_action( 'mh_magazine_lite_post_meta' );

    Am I missing anything there?

    Thanks. Sorry to be a pain.

    • This reply was modified 7 years, 9 months ago by whatevaitis.
    Thread Starter whatevaitis

    (@whatevaitis)

    When you said to copy the function

    
    mh_magazine_lite_post_meta()

    from my parent theme, I don’t know if the text above is all there is or if it’s part of a bigger block of code. I can’t find this line in the parent theme.

    Thread Starter whatevaitis

    (@whatevaitis)

    I’m happy to pay for support/make a donation. Do you have a PayPal or something?

    Thread Starter whatevaitis

    (@whatevaitis)

    I GOT IT.

    Thank you.

    I’m not too bright about this stuff.

    Still interested in donating/paying for support.

    Ok, we’re happy that you’ve got it now. No need for a donation, but thanks for asking. Have a nice sunday. ??

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Child theme: .entry-meta styles don’t work after removing link from post date’ is closed to new replies.