Modified Date vs Post Date and Text Wrap Images

Welcome Forums BigBangWP Modified Date vs Post Date and Text Wrap Images

This topic contains 5 replies, has 2 voices, and was last updated by  Brankic1979 1 month, 3 weeks ago.

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

    engin33r
    Participant

    First off, love the theme and it’s functionality. Thank you so much for building something so beautiful and keeping up with the support. It’s amazing and I’d rate this even higher if I could.

    Two questions. First off, I’m trying to change my post date to be the post modified date. I’ve tried adding the following to the child theme under functions:

    
    function wpb_last_updated_date( $content ) {
    $u_time = get_the_time('U');
    $u_modified_time = get_the_modified_time('U');
    if ($u_modified_time >= $u_time + 86400) {
    $updated_month = get_the_modified_time('F');
    $updated_day = get_the_modified_time('d');
    $updated_year = get_the_modified_time('Y');
    $updated_date = get_the_modified_time('F jS, Y');
    $updated_time = get_the_modified_time('h:i a');
    $custom_content .= '<p class="last-updated"><b>Last updated on '. $updated_date . '</b></p>'; 
    }
    
        $custom_content .= $content;
        return $custom_content;
    }
    add_filter( 'the_content', 'wpb_last_updated_date' );
    

    But I can’t figure out where to change out the date itself since this line which seems to call the date code appears all over:

    
    <div class="date"><span class="month"><?php the_time('M'); ?></span><span class="day"><?php the_time('d'); ?></span><span class="month"><?php the_time('Y'); ?></span></div>
    

    I’ve even tried changing some of the variables to the newly created variables i’ve made in the functions.php child that I made but it doesn’t seem to pull through. But I’m definitely not 100% php knowledgable so I may be messing up.

    Any ideas?

    Second Question… I’m trying to wrap some text around an image on the webpage but if I have a Header tag it will put the header below the image and not wrap it around the image. This leaves a gap that looks silly. Is there anyway to keep headers wrapped around the image? I read online that adding this css code should help but it didn’t do anything for me.

    
    /* Wrap Text Around Images */
    img.alignright { float: right; margin: 0 0 1em 1em; }
    img.alignleft { float: left; margin: 0 1em 1em 0; }
    img.aligncenter { display: block; margin-left: auto; margin-right: auto; }
    .alignright { float: right; }
    .alignleft { float: left; }
    .aligncenter { display: block; margin-left: auto; margin-right: auto; }
    

    Once again thank you so much for the help.


      Quote
    #6787

    Brankic1979
    Keymaster

    Hi,

    You have to replace the_time with the_modified_date in the php file (page-blog-X.php or index.php and single.php (or you can show me the URL and I tell you exactly what file you have to edit in your child theme).

    <div class="date"><span class="month"><?php the_modified_date('M'); ?></span><span class="day"><?php the_modified_date('d'); ?></span><span class="month"><?php the_modified_date('Y'); ?></span></div>
    

      Quote
    #6788

    Brankic1979
    Keymaster

    Please show me the URL of the page/post where you want to wrap text around image, so I could give you exact code.


      Quote
    #6797

    engin33r
    Participant

    Thanks for the reply.

    I tried changing out the code to your suggestion in the above posts. I modified the code in all the page-blog-X.php pages and all the references in the index.php pages. I couldn’t find it anywhere in single.php but that code is slightly confusing to me. I also found the above line referenced in a few of the content-XXXXX.php pages but left that alone.

    Here is an example of the php working (see the top of the page where i mention the original and modified date). I would love it if the date box showed the modified date so it felt more current.

    Also on that page, you can see the text wrap problems i’m having. It appears that the header doesn’t want to wrap. Any ideas would be greatly appreciated.

    Let me know if you need anything else. Thanks so much for the help.


      Quote
    #6807

    Brankic1979
    Keymaster

    Hi,

    I forgot that these content-XXXX.php files are for single posts. Change the code there too.

    Sorry…


      Quote
    #6808

    Brankic1979
    Keymaster

    About wrapping images.

    You can’t wrap it if there’s heading.

    Heading elements can be wrapped around image if you change it’s default css.

    You can add

    
    style='clear: none;'
    

    to that h3 tag in text editor. it should work.


      Quote
Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.