This topic has 18 replies, 3 voices, and was last updated 8 years by Abe.

  • Author

    Tagged: ,

  • #111673
     mitchcan
    Participant

    Hey,

    I’m wondering if there is an easy way within Kleo to create a page that returns ONLY posts with a publish date of “today.”

    I’ve seen some general wordpress code, but I’m not exactly sure how it would relate to a display in this theme.

    Appreciate any guidance.

    Thanks.

    #111878
     Laura
    Moderator

    Hello, please create a new folder at the child theme with the name page-templates
    and then drop these files inside and replace the .txt with .php
    Now create a page and select the template at the sidebar 🙂

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    Laura Solanes - Graphic Designer and Web Designer

    Please be patient as I try to answer each topic as fast as i can.

    If you like the theme or the support you've received please consider leaving us a review on Themeforest!

    Always happy to help you 🙂

    Attachments:
    You must be logged in to view attached files.
    #111884
     mitchcan
    Participant

    Hi Laura,

    Thanks so much for your help here. A couple followup questions.

    1) For some reason, this still pulls a couple of random posts that are NOT published ‘today.’ A total of 5 additional posts, some with a publish date back to 2014, are included in the rendered archive page.

    I looked for similarities in the posts, but I can’t tell why they are they.

    (Note: I’m using the w/ sidebar version).

    2) Also, curious if the line:
    echo ‘<div class=”row responsive-cols kleo-masonry per-row-‘ . sq_option( ‘blog_columns’, 3 ) . ‘”>’;
    is supposed to have it display 3 columns? For some reason it shows 4?

    3) Lastly, is there a way to modify this to limit it to a specific category?

    Thanks again, I appreciate it.

    #111886
     mitchcan
    Participant

    Hey,

    I think maybe I figured it out.

    There are six additional posts that show. ALL six have a ‘date’ of the 20th (‘today’s date – 3/20/16), but they are from various months and years.

    5/20/15
    8/20/14
    7/20/12
    5/20/11
    9/20/14
    4/20/11

    So maybe the code is pulling based on the date, without consideration of the month and year?

    Any thoughts?

    Thanks again.

    #111895
     Laura
    Moderator

    Hello, sorry, here its the fix, also included 2 more, the category ones, just modify the code, find ‘events’ and change for the category you want, you can copy and paste to create more categories, juts change the part:

    COPY CODE
    
    /**
     * Template Name: Today Posts Cat1
     *
     * Description: Today Posts Sidebar Category 1
     *
     * @package WordPress
     * @subpackage Kleo
     * @author SeventhQueen <themesupport@seventhqueen.com>
     * @since Kleo 1.0
     */
    

    To Cat2 or Events or anything else 🙂
    Hope this works

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    Laura Solanes - Graphic Designer and Web Designer

    Please be patient as I try to answer each topic as fast as i can.

    If you like the theme or the support you've received please consider leaving us a review on Themeforest!

    Always happy to help you 🙂

    Attachments:
    You must be logged in to view attached files.
    #111901
     mitchcan
    Participant

    Excellent. I will give the various options a try and report back.

    Thank you for your timely support. Have a great day.

    #111910
     Laura
    Moderator

    Glad to help 🙂 Let me know if it works

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    Laura Solanes - Graphic Designer and Web Designer

    Please be patient as I try to answer each topic as fast as i can.

    If you like the theme or the support you've received please consider leaving us a review on Themeforest!

    Always happy to help you 🙂

    #111911
     mitchcan
    Participant

    Hi again,

    OK, this is great. The updated code works well, but in testing there was just one hitch. Time.

    The code seems to pull based on UTC. Our WP was set to our time zone (PST). This made it where when checking for posts, there were none rendered if the user was on the site anytime after UTC 00:00, – so basically for the last 7 hours of any day ‘today’s’ posts returned none.

    I confirmed this by changing the WP time to UTC 00:00 and changing a couple posts to UTC ‘today’ date/time – the code worked great, including the category versions.

    So on this, the only outstanding issue would be how to account for a different local timezone, e.g. UTC -7.

    Can that be done?

    Thanks!

    #111918
     mitchcan
    Participant

    One other item I noticed in testing, the part of the template that displays the “Bottom Content” (“kleo-page-bottom”) does not seem to render on the page layout with the new code(s).

    In looking at the code, and comparing between the new code you provided and the default page layout(s) (like left-sidebar, etc…), there are some items not in the new code. Could those be added to the new code to again display the optional “Bottom Content” on those pages?

    Note: I did try to mess with adding the get_template_part items from the default layouts, but just blew up the page. But hey, at least I tried. 🙂

    Thanks.

    #112246
     Laura
    Moderator

    Hello right now the code is very basic, you can use it as a base and ask a developer to modify it 🙂

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    Laura Solanes - Graphic Designer and Web Designer

    Please be patient as I try to answer each topic as fast as i can.

    If you like the theme or the support you've received please consider leaving us a review on Themeforest!

    Always happy to help you 🙂

    #112255
     mitchcan
    Participant

    OK, I understand. Thanks for getting me this far. 🙂

    I’ll look elsewhere to try and figure out the time issue.

    The reason I asked on the Kleo ‘Bottom content’ not displaying because it was something related to the theme. It seems like the code simply needed to refer back to something in the Kleo page templates, and I thought you might readily know.

    If you can point me to what is lacking from the page templates to the new code, I can try and get it working.

    Thank you.

    #112639
     Laura
    Moderator

    Hello, i see, well actually there is not much difference, can you share credentials so i can test it at your site? 🙂 (ftp/wp-admin)

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    Laura Solanes - Graphic Designer and Web Designer

    Please be patient as I try to answer each topic as fast as i can.

    If you like the theme or the support you've received please consider leaving us a review on Themeforest!

    Always happy to help you 🙂

    #113728
     mitchcan
    Participant

    Hi Laura,

    I just wanted to update. I resolved this issue. I’ll post here, in case I forget later I can check back. 🙂

    For the template, looking at my notes, best I can tell is I added:

    COPY CODE
    <?php
    //create 3lr template
    kleo_switch_layout('3lr');
    ?>
    

    to the code, which seemed to get me the sidebar and footer. Not sure if that’s what did it, but it works now. 🙂

    For the time zone issue, I simply used:

    COPY CODE
    <?php
    $args = array(
        'post_type' => 'post',
        'post_status' => 'publish',
        'orderby' => 'date',
        'order' => 'DESC',
    
        // Using the date_query to filter posts from last week
        'date_query' => array(
            array(
                'after' => '30 hours ago'
            )
        )
    ); 
    query_posts( $args );?>

    instead of the getdate and made it a lookback of 30 hours. Not perfect, but I got tired of trying to figure out how to adjust the query to account for UTC vs. local TZ. 🙂

    Thanks again for getting me that far.

    Hey @abe – it’s support like this from @laura and what @sharmstr always provides that will make it where I buy another license for this theme next month.

    Thanks.

    #113740
     mitchcan
    Participant

    OK, I take that back — not the good support part 🙂 – but the I fixed it part.

    That first piece of code I added made it a 3 column page. Forgot that. Ooops. And the TZ issue is as resolved as I’m going to get it.

    But the other issue was that the “kleo-page-bottom” did not show on the page template. I’ve tried about 15 variations of the code, with no joy.

    Attached screencap shows that kleo-page-bottom IS there. And I DO have some content in that box on that page (tested with the Default template and it DOES show there). But for some reason it doesn’t show with this page template.

    I do have some functions code that I thought might mess with it:

    COPY CODE
    /* this added a widget area after main content ONLY */
    add_action( 'kleo_after_main_content','kleo_main_content_bottom');
    function kleo_main_content_bottom() {
          echo '<div id="after-main-content">', do_shortcode('[widgets_on_pages id="wop-5"]'), '</div>';  //you could put a shortcode here if you want, too.
    }

    but lack of display issue remains even if I comment out that code. So it has to be something in the template.

    Any guidance on where to look is still appreciated. If it proves too difficult, I could just move on, but little things that seem like they should work but don’t always get me. 🙂

    Thanks!

    Attachments:
    You must be logged in to view attached files.
    #114051
     Laura
    Moderator

    Hello, i will let @radu take a look, i am sure he will be happy to help you with that small issue 😀

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    Laura Solanes - Graphic Designer and Web Designer

    Please be patient as I try to answer each topic as fast as i can.

    If you like the theme or the support you've received please consider leaving us a review on Themeforest!

    Always happy to help you 🙂

    #114052
     Laura
    Moderator

    BTW, Thanks you for the nice comment 🙂

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    Laura Solanes - Graphic Designer and Web Designer

    Please be patient as I try to answer each topic as fast as i can.

    If you like the theme or the support you've received please consider leaving us a review on Themeforest!

    Always happy to help you 🙂

    #116652
     Abe
    Keymaster

    Hi, I looked trough your discussion and I couldn’t tell what code remained on your site and what issue you are having now?

    Please remember that this support site is not for custom work and this is to help you with theme questions or problems. If you want custom work please hire a developer

    Thanks

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    ---
    @ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.

    #116665
     mitchcan
    Participant

    I understand the limitations of support vs. custom work. That’s why I was asking if a solution was something that was *simple and readily available*, based your teams much more in-depth knowledge of the theme than mine (or another devs).

    Where you could look at it and easily say, yeah, the kleo bottom content is not showing because you don’t have ‘xyz’ and then I could add it.

    And that’s why I didn’t take it any farther on the time zone question, as I am well aware that that is more along the lines of custom work, not like the kleo content theme question.

    So anyway, yes, thank you to @Laura for helping get me that far. The only remaining issue was why kleo bottom content was not displaying in that code.

    If that’s easy to see, great, I’d love to know why. If it takes a ton of custom code, than, no, that’s not part of the deal. I get that.

    Thanks again for the support you guys do provide. As I have more sites that are coming up for a refresh, I will be purchasing more licenses because of the great looking theme and the solid support behind it.

    #116957
     Abe
    Keymaster

    Unfortunately I can’t tell what is going on there 🙂 otherwise I definitely would have helped

    Try getting a programmer that can help you with customisations and can focus on your needs.

    All the best

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    ---
    @ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.

Viewing 19 posts - 1 through 19 (of 19 total)

The forum ‘General questions’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?