Forum Replies Created
-
AuthorPosts
-
AnthonyMemberThis might shed a little light … I changed it to ‘radio’ and this is what it did:
Attachments:
You must be logged in to view attached files.
AnthonyMemberThis reply has been marked as private.
AnthonyMemberThis reply has been marked as private.
AnthonyMemberno it doesn’t.
AnthonyMemberI did set it as a taxonomy to start things off, yeah. Right now I am trying to figure out how to get the setting to stick at this point. Since every time I update the post it doesn’t save it…
I can see that my
query->setto ameta-keywas misguided. Any ideas as to why the setting won’t even stick?
AnthonyMemberSorry about that. Thank you .. nothing like reading the manual.
AnthonyMemberNever mind I figured it out. The code was correct.
AnthonyMemberI RTFM the related posts section of the documentation and found that it was better to use get_posts() instead of get_post_meta():
?php if (have_posts()) : ?> <section id="main" class="wrapper style3"> <?php while (have_posts()) : the_post(); ?> <?php $purchasers = get_posts(array( 'post_type' => 'sponsor' ,'posts_per_page' => -1 ,'post_belongs' => $post->ID ,'post_status' => 'publish' ,'suppress_filters' => false // This must be set to false )); var_dump($purchasers); // do we have a pulse?I keep getting no results. Sorry about posting in the other thread. I thought it was cross related. No issue-pun intended.
AnthonyMemberI think this thread is addressing a similar (basic problem) for me. I have a custom post type that I am using Piklist to relate to my regular posts. If the regular post has the related post checked off then it should display the singular template in a certain way otherwise it reverts to its default.
<?php while (have_posts()) : the_post(); ?> <?php $purchase = get_post_meta(get_the_ID(), 'sponsor', true ); var_dump( $purchase ); ?> <?php if( ! $purchase ) { ?> <div class="inner"> <ul class="author-post actions"> <li><a class="icon-wrapper circle" href="<?php echo get_author_posts_url( get_the_author_meta( 'ID' ) ); ?>"> <?php echo get_avatar( get_the_author_meta( 'ID' ), 48 ); ?> </a></li> <li><a href="<?php echo get_author_posts_url( get_the_author_meta( 'ID' ) ); ?>"> <?php echo get_the_author();?></a> <br /><?php posted_on(); ?></li> <li><li><a href="<?php the_permalink();?>" class="button">Purchase</a></li></li> </ul> </div><!-- inner //-->The issue is that the var_dump reveals:
string(0) ""It’s simply not getting any results, therefore my template is always displaying the “false” conditional.
AnthonyMemberYeah I am using the beta. Figured it out … just had to change to $post->ID. Gotta update your support doc to reflect that change — I suspect.
AnthonyMemberAlright i see that $post_id doesn’t have a value set. Now the question is why?
AnthonyMemberI have tried something similar to no avail using your reference code.
<?php $sponsor_call = get_posts(array( 'post_type' => 'sponsor' // Set post type you are relating to. ,'posts_per_page' => 1 ,'post_belongs' => $post_id // ,'post_status' => 'publish' ,'suppress_filters' => false // This must be set to false )); foreach ($sponsor_call as $the_sponsor): echo '<h6 class="the_sponsor" style="margin-top:4em;">' . $the_sponsor->post_title . '</h6>'; endforeach; ?>This appears to grab the first sponsor off my list. It doesn’t get the one that is check marked. Side question that would be great once this is figured out is whether or not post-relates can behave like radio buttons instead?
AnthonyMember@kattagami – This code above was a real help. Now that I am able to get the events to list with a little date stamp (see attachment). Is it possible to parse the_date() from the date picker to work in a fashion such as this?
<?php if (true == get_post_meta($the_query->ID, 'mr_evenement_date_timestamp', true) ) { ?> <p class="date"><?php echo get_post_meta($the_query->ID, 'mr_evenement_date_timestamp', true);?></p> <?phpI am trying to get the date to be consisting of just the day number and the month.
Attachments:
You must be logged in to view attached files.
AnthonyMemberIs there an ETA for full release? I like how the beta performs.
AnthonyMemberBRILLIANT! Looking forward to it. Thank you for constructing such an ingenious CMS solution for WordPress. Keep up the great work .
-
AuthorPosts