• Resolved blubbubb

    (@blubbubb)


    Hey Rick,
    the plugin works well, but one question (I should improve my PHP skills) ..

    I need to change the date format specific to German, I need DD-MM-YYYY instead of the english notation. How do I do that with a filter or another way? Couldn’t find any Date attribute in the code.

    Another suggestion I have: The content after the mpr_heading (‘Site 1 – … site location’) [Line 377/380 in the plugin files hould be wrapped with a div for easier formatting (in my case I don’t want to display it). Did it manually, got to remind that when I update your plugin ??

    Thanks again, for any help you will receive a hot chocolate or a muffin ??

    Greets,
    Lars

    • This topic was modified 5 years, 8 months ago by blubbubb.
    • This topic was modified 5 years, 8 months ago by blubbubb.

    The page I need help with: [log in to see the link]

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Rick Hellewell

    (@rhellewellgmailcom)

    Interesting idea. Right now the format of the date is hard-coded in the plugin. I suspect there is probably some way to use the site’s date format instead of hard coding it.

    I’m currently traveling (research on the next book I am writing, and visiting family), so will cogitate on this a bit and then work on it when I return home.

    Thanks for the idea.

    …Rick… (If you are interested in the fiction books I have written, go here .)

    Plugin Author Rick Hellewell

    (@rhellewellgmailcom)

    @blubbubb

    I’d forgotten about this question while I was working on my latest fiction book.

    But, the WP docs say that the post_date value of the current post (which is used to display the date of the post) uses the system date format settings (in Administration, Settings, General).

    So, does your date output (when using this plugin and the shortcode) follow the settings on that page?

    Thanks….Rick…

    Thread Starter blubbubb

    (@blubbubb)

    Hi Rick,
    sorry … a lot to do during the last months.

    The date output doesn’t follow the settings on the page(s).
    The output is “2019/12/16” on my site, I need the settings for the german timezone, e.g. ‘16.12.2019’ or in mysettings ’16. Dezember 2019′. Tried to change the formatting in the backend, nothing happens.

    Thanks in advance and Merry Christmas,
    Lars

    Plugin Author Rick Hellewell

    (@rhellewellgmailcom)

    Heh…I forgot about this also with all my other projects.

    Can you changing this code around line #532:

    if (!$atts['nodate']) {		
    echo '<span class="mpr_post_date">' . get_option('date_format'), $x->post_date  . "</span>";
    }

    That takes the time setting in your site’s admin area and applies it to the output of the post_date in the Loop.

    Let me know how it works for you. If OK, then I’ll do a quick update of the code.

    Note that on my list of projects is an update of this plugin to combine the various display and posts of this and my similar plugins into one new plugin that will do posts, pictures, plus all the options. Not sure when I’ll have time for it, though.

    Thread Starter blubbubb

    (@blubbubb)

    Hi Rick,
    unfortunately that doesn’t work .. I’m getting the output ‘d.m.Y2019-06-16 20:17:42 ‘ in the frontend.
    Did some research, so I tried:

    if (!$atts['nodate']) {		
      echo '<span class="mpr_post_date">' . date(get_option('date_format'), strtotime($x->post_date))  . "</span>";
    }

    This works better, the only problem for me is that the month name doesn’t get translated. But that’s not a big deal for me, instead of ’17.Dezember 2019′ it’s okay for me to display ‘17.12.2019’

    Btw.: sounds good with your project, I’m very interested ??

    Plugin Author Rick Hellewell

    (@rhellewellgmailcom)

    According to the docs, that line (with your corrections) should get the date format as defined by the date/time format on the Settings, General page. Does that setting match the output of the shortcode on your system?

    Thread Starter blubbubb

    (@blubbubb)

    Yes it does, only the translation doesn’t work

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Changing the date format / Wrapping hr and strong’ is closed to new replies.