Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Justin Sternberg
@jtsternberg
Sure you can
You can use the show_on_cb box property to determine if/when a box should show
Ian Barker
@iantbarker
Like this?
    'show_on'      => array( 'key' => 'page-template', 'value' => 'page-specials.php' ),
madvic
@madvik
@jtsternberg Thanks
Ian Barker
@iantbarker
@jtsternberg I thought Page Template show_on filter would accomplish this but breaks everything
@jtsternberg By break, I mean no metaboxes appear
Justin Sternberg
@jtsternberg
@iantbarker I'm not sure, maybe open an issue on Github and @tw2113 might be able to look at it with you. Be sure to include your entire config code.
Ian Barker
@iantbarker
Ok thanks
Justin Sternberg
@jtsternberg
@madvik thanks a ton! looks solid. I'll update a few things.
@madvik why is some of it commented out?
Justin Sternberg
@jtsternberg
oh, i see your comment. and you're right. I'll move it there.
Justin Sternberg
@jtsternberg
@madvik thanks again for your help. I've updated it and renamed: https://github.com/WebDevStudios/CMB2/wiki/Box-Properties
Ian Barker
@iantbarker
@jtsternberg I added an issue on Github. Thanks.
Justin Sternberg
@jtsternberg
@iantbarker responded. the docs should be pretty clear, but feel free to ping me here not.
Justin Sternberg
@jtsternberg
-sameroom open
Sameroom
@sameroom-bot
<Sameroom> Your code is AJUES
Justin Sternberg
@jtsternberg
-sameroom portal
Sameroom
@sameroom-bot
<Sameroom> Your Portal URL is https://sameroom.io/LcOBqUqM -- you can send the URL to someone on a different team to share this room. Note: you can connect more than two teams this way.
<Sameroom> I've connected 1 new room #gitter (CMB2) on Slack. See map
[JT Sternberg, CMB2] test
Justin Sternberg
@jtsternberg
test
Sameroom
@sameroom-bot
<Sameroom> I've connected 1 new room _#webdevstudios_cmb2 (CMB2)_ on Slack. See map
Justin Sternberg
@jtsternberg
test
Justin Sternberg
@jtsternberg
[Chris Reynolds, CMB2] @jt so does gitter feed into here directly?
Justin Sternberg
@jtsternberg
@jazzsequence yes
mehdihfz
@mehdihfz
Hi, Please help me because I change the date of the lunar to solar
glencld
@glencld
hi is there a way in getting a data from CMB1 to CMB2?
Chris Reynolds
@jazzsequence
@glencld It's all post meta, so the data is already there as long as you access it using the same meta keys.
@mehdihfz I don't know what that means.
glencld
@glencld
@jazzsequence Thank you for helping :D
s1dekick223
@s1dekick223

Hey,

i’m new to cmb2 and i hope you can help me.

I want to echo my posts but only when i triggered a checkbox in backend.

this is my current code im a little bit lost.

<?php get_header(); ?>

<?php

$taxonomies = get_object_taxonomies( array( 'post_type' => 'faq',) );

foreach( $taxonomies as $taxonomy ) :

// Gets every "category" (term) in this taxonomy to get the respective posts
$terms = get_terms( array( 'taxonomy' => 'faqt', 'parent' => 0, 'hide_empty' => 0, ) );

foreach( $terms as $term ) : ?>

<div>
<h3><a href='faqt/<? echo $term->slug; ?>'><? echo $term->name; ?></a></h3>
</div>

    <?php
    $args = array(
            'post_type' => 'faq',
            'posts_per_page' => -1,
            'tax_query' => array(
                array(
                    'taxonomy' => $taxonomy,
                    'field' => 'slug',
                    'terms' => $term->slug,
                )
            )

        );
    $posts = new WP_Query($args);

    if( $posts->have_posts() ): while( $posts->have_posts() ) : $posts->the_post(); ?>


<ul>
    <li><a href="<?php echo get_permalink(); ?>"><?php  echo get_the_title(); ?></a></li>

</ul>

                    <?php the_excerpt(); ?>


    <?php endwhile; endif; ?>

<a href='faqt/<? echo $term->slug; ?>' class=“btn btn-secondary”>Alle Fragen</a>

</div>

<hr/>

<?php endforeach;

endforeach; ?>

<?php get_footer(); ?>
I hope you guys can help me

thx ! 🙂

s1dekick223
@s1dekick223
i got it guys :D
sam-stark
@sam-stark
Hi, I created a group of fields for a custom post type but cannot get them to display on my single page template. Is there an example of the structure used to display information from groups?
Chris Reynolds
@jazzsequence
@sam-stark Not sure if there's a specific example (maybe check the CMB2-Snippet-Library) but what I generally do if I don't know how to call stuff is var_dump( get_post_meta( $post_id, '_cmb2_group_name', true ) ); and go from there
Justin Sternberg
@jtsternberg
jitulutya
@jitulutya
how can i apply "show_on" for my custom admin menu
Justin Sternberg
@jtsternberg
We'll need more information than that in order to help.
bentalgad
@bentalgad
The snippets for creating a theme options page suppose to go like they are (changing only the prefix) to the functions file and work? because if i do that i don't see any page created?
Oh, ok got it in to a plugin. working great. thanks!
fastmarketo
@fastmarketo
I have created this Option → $cmb->add_field( array(
'name' => 'Select Video or Image',
'desc' => 'Select an option',
'id' => $prefix . 'image_or_video',
'type' => 'select',
'show_option_none' => true,
'default' => 'custom',
'options' => array(
'standard' => ( 'Option One', 'cmb2' ),
'custom' =>
( 'Option Two', 'cmb2' ),
'none' => __( 'Option Three', 'cmb2' ),
),
) );
what i want is If Option two is selected is true then execute some php code
But how should In write this
Justin Sternberg
@jtsternberg
@fastmarketo I responded to your question on the support forum
fastmarketo
@fastmarketo
can you guide me wghere is thes upport forum?
*support
Justin Sternberg
@jtsternberg
fastmarketo
@fastmarketo
Yes sir, this is me. I got it sir. Thanks a lot sir.