Forum Replies Created

Viewing 15 replies - 31 through 45 (of 121 total)
  • Thread Starter mxpimp47

    (@mxpimp47)

    Ahh ok. I will have to do some tinkering to figure it out. Thanks for the help!

    Thread Starter mxpimp47

    (@mxpimp47)

    I got it working.

    So this usage is UTC which is 6 hours ahead of central time. If I want this to work off the WordPress time setting, I have to be using the test_datetime_timestamp_timezone and have php 5.3 or above correct? Otherwise I have to set the date/time picker 6 hours ahead?

    Thread Starter mxpimp47

    (@mxpimp47)

    Do I use custom a loop like I have? I inserted it like this and it breaks the site from loading. http://pastebin.com/HJybrSyU

    Thread Starter mxpimp47

    (@mxpimp47)

    I can get it to display based on start date/time, but when I set the end date/time it still displays. I know I am doing something wrong. Thought I would post my code.

    http://pastebin.com/gxCBHuF5

    Thread Starter mxpimp47

    (@mxpimp47)

    Ok, had a brain fart. I may start a new thread for some actual query help outside of this thread. Thank you for the support!

    Thread Starter mxpimp47

    (@mxpimp47)

    Almost, here is my code for displaying multiple meta boxes – http://pastebin.com/HDwafuiq. When it loads on the page, the dates are defaulting to the date specified from “test_metabox”. That is the first one in my functions file which controls something else I am using. I thought by having a different meta_box ‘id’, that it wouldn’t conflict.

    EDIT – Just change the ‘id’ after the $prefix correct?

    Thread Starter mxpimp47

    (@mxpimp47)

    Correct, the display/querying isn’t related to the plugin directly. But it does allow me to display the information I want based off your plugins usage with a customized date, not the date the page is created. The format date format doesn’t matter specifically for my situation, cause I just need to display the title of the page with the meta tied to it.

    I was struggling to connect the dots and display the information based off the relationship of the meta and the page in the database.

    Thank you for the help! And for a good meta plugin that is being managed. Over the past year or so I was using some other dated meta plugins that were no longer being updated.

    EDIT – Can I have multiple datetime_timestamp meta boxes on the same page?

    Thread Starter mxpimp47

    (@mxpimp47)

    Ok, I removed the code I pulled from github. Installed the plugin through ww.wp.xz.cn. Added the necessary code to my functions file – http://pastebin.com/G842fGt4

    Then my args, and query are this – http://pastebin.com/3h50X0Pj

    I tested a page with the date of today and set at 6:00pm and it displayed. I changed the time to this morning, and it displayed the next event. So its working so far at the minimal usage.

    Do you see anything that I should change? In the meta_query array is “type” used correctly or even necessary? I removed it and it worked. I was getting help from another person and between them and I, I have tried so many combinations of code to make this work correctly.

    One other usage I would like to use your custom meta on the same pages would be to display a string of text with a link (in my header) based off a date and time period from say sat jan 3rd 7:00am to sunday jan 4th 6:00pm. Is that possible using your meta plugin having specific parameters like that? So you can understand exact reasoning its because we have a live audio broadcast during the days of the event. And a link would automatically appear when those date and times hit. And its just a cool little bonus to have automated. People come to my site looking for the “live broadcast”. And I would have it right in their face. See image (look at top left of header). http://imgur.com/uqfBpv0

    Thread Starter mxpimp47

    (@mxpimp47)

    I found the code of yours on github, maybe I didnt realize it wasn’t the latest. But I am using this meta on pages, not posts. Does that matter?

    Thread Starter mxpimp47

    (@mxpimp47)

    Here is a link to all the code in my template for displaying the title of the Page using the meta. http://pastebin.com/9kqwdNTD

    Here is the code in my functions file for the meta type.
    http://pastebin.com/Nqb7LAuh

    Thread Starter mxpimp47

    (@mxpimp47)

    So how should I re-write the query to be using your method? I have tried several but failed. My limited programming skills aren’t getting the job done!

    Thread Starter mxpimp47

    (@mxpimp47)

    When I changed the code to this (changed the compare to greater than equal to)

    <?php
                    $args = array(
    		    'post_type' => array( 'page' ),
    		    'order' => 'DESC',
    		    'orderby' => 'meta_value_num', 'time()', // Numeric sort.
    		    'posts_per_page' => 1,
    		    'meta_query' => array(
    		        array(
    		            'key' => '_cmb_test_textdate_timestamp',
    		            'compare' => '>=',
    		            'value' => time(), // Current timestamp.
    
    		        ),
    		    ),
    		);
    
                    $the_query = new WP_Query( $args );
                    ?>

    It stops showing the current event when its already on the date vs the end of the day. And it wont show the next date unless its 48 hours roughly from the current date. So if you had events back to back days it wont show the next event, it would skip right over.

    Thread Starter mxpimp47

    (@mxpimp47)

    I dont know how to currently get the correct data from the database. I changed it up and was using the test_textdata_timestamp. I am seeing results now, but its still not perfect. When I change the date to past tense on a page, it still shows that page with the meta displayed where I have the custom loop.

    <?php
                    $args = array(
    		    'post_type' => array( 'page' ),
    		    'order' => 'DESC',
    		    'orderby' => 'meta_value_num', 'time()', // Numeric sort.
    		    'posts_per_page' => 1,
    		    'meta_query' => array(
    		        array(
    		            'key' => '_cmb_test_textdate_timestamp',
    		            'compare' => '<=',
    		            'value' => time(), // Current timestamp.
    
    		        ),
    		    ),
    		);
    
                    $the_query = new WP_Query( $args );
                    ?>
    
                    <?php if( $the_query->have_posts() ): ?>
    
                    <?php while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
    
                    <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
    
                    <?php endwhile; ?>
    
                    <?php endif; ?>
    
                    <?php wp_reset_query(); ?>
    Thread Starter mxpimp47

    (@mxpimp47)

    Seems to be theme related to Underscore _s theme.

    Thread Starter mxpimp47

    (@mxpimp47)

    Ok, plugins werent an issue. But then I tried another theme, and that seems to be the problem somehow. I am using the underscore _s starter template which I have fully customized etc… I need to find out what could be the problem. Sheesh

Viewing 15 replies - 31 through 45 (of 121 total)