pultz
Forum Replies Created
-
Forum: Plugins
In reply to: [WP Store Locator] Some countries does not workwas a error about it not being able to show more then 100
Forum: Fixing WordPress
In reply to: Custom Meta Box Checkbox not printingThanks so much for the help @rajanit2000, if anyone need help ask him.
Here is the result that made it work for me.
my function.php code:
add_action( 'admin_init', 'my_admin_portfolio' ); function my_admin_portfolio() { add_meta_box( 'portfolio_meta_box', 'Programs used', 'display_portfolio_meta_box','Portfolio', 'normal', 'high' ); } function display_portfolio_meta_box( $portfolio ) { ?> <h4>2D Programs</h4> <table width="100%"> <tr> <td style="width: 25%">Photoshop</td> <td><input type="checkbox" style="width:425px;" name="meta[Photoshop]" value="True" <?php if( get_post_meta( $portfolio->ID, 'Photoshop', true ) == "True" ) {?>checked<?php }?> /> </td> </tr> <tr> <td style="width: 25%">Illustrator</td> <td><input type="checkbox" style="width:425px;" name="meta[Illustrator]" value="True" <?php if( get_post_meta( $portfolio->ID, 'Illustrator', true ) == "True" ) {?>checked<?php }?> /> </td> </tr> </table> <?php } add_action( 'save_post', 'add_portfolio_fields', 10, 2 ); function add_portfolio_fields( $portfolio_id, $portfolio ) { if ( $portfolio->post_type == 'portfolio' ) { if ( $_POST['meta']['Photoshop'] == "True" ) { update_post_meta( $portfolio_id, 'Photoshop', 'True' ); }else{ update_post_meta( $portfolio_id, 'Photoshop', 'False' ); } } }
this is my single.php code (where i print it):
<?php if (get_post_meta(get_the_ID(), 'Photoshop', 'Illustrator', 'Maya', 'zbrush', 'sDesigner', 'After', 'Premiere', 'Nuke') == null) { echo "<div class='nosoftware'><h3>No software has been picked!</h3></div>"; } else { if (get_post_meta( get_the_ID(), 'Photoshop', true ) == "True") { echo "<div class='software'><img src='"; ?><?php bloginfo('template_directory'); ?><?php echo "/img/logos/Photoshop.png' /><h3>Photoshop</h3></div>"; } if (get_post_meta(get_the_ID(), 'Illustrator', true) == "True") { echo "<div class='software'><img src='"; ?><?php bloginfo('template_directory'); ?><?php echo "/img/logos/ill.png' /><h3>Illustrator</h3></div>"; } }
Forum: Fixing WordPress
In reply to: Custom Meta Box Checkbox not printing@anevins just so you know. but even though you redacted the mail i still got it in my mail ?? so is that something the forum should look into maybe?
Forum: Fixing WordPress
In reply to: Custom Meta Box Checkbox not printingForum: Fixing WordPress
In reply to: Custom Meta Box Checkbox not printingwell that kinda worked i can see on my front end that it change to false but the dropdown still puts it on true even when its false.
and really want it to be a checkbox if you have a way to things this problem for the checkbox ??
Forum: Fixing WordPress
In reply to: Custom Meta Box Checkbox not printingthanks it’s almost there the only problem i have left now is i can’t uncheck and update it. then it will always remember that it was checked ad stay checked.
what am i doing wrong there?
Forum: Fixing WordPress
In reply to: Custom Meta Box Checkbox not printinghere is the function as said i made it work now i just need to be able to have more then one and get the checked vale on my single.php
this is my single.php code
<?php if (have_posts() ): while(have_posts() ) : the_post(); ?> <h3><?php the_title(); ?></h3> <p><?php the_content(); ?></p> <?php echo get_post_meta( get_the_ID(), 'check_1', true );?>
Forum: Fixing WordPress
In reply to: Custom Meta Box Checkbox not printingi fixed it my bad. now i just need a way to make the if statment on my single.php
like
if(check_1 == checked)
do something
else
dont do it.do you have anything?
Forum: Fixing WordPress
In reply to: Custom Meta Box Checkbox not printingthe issue is that when i check the box and then press update. it’s unchecked again
Forum: Fixing WordPress
In reply to: Custom Meta Box Checkbox not printingfirst think i still cant get it to save on my admin page. if i update the product after checking it it goes back to not checked.
2nd i dont get the <?php echo get_post_meta( get_the_ID(), ‘check_1’, true );?>
could you maybe make it in to an if
like
if(check_1 == checked)
do something
else
dont do it.something like that?
Forum: Fixing WordPress
In reply to: Custom Meta Box Checkbox not printingLoL my bad. but now i have the problem i had a long time ago.
when i update my item it wont stay checked so guess there’s something in the save option that needs to be change?
and can you send me some code that so i can print it out on the front page?
if its check i want to be able to do something els do nothing like that?
i appreciate all your help.
Forum: Fixing WordPress
In reply to: Custom Meta Box Checkbox not printingthink there is something wrong with this line
<input type="checkbox" style="width:425px;" name="meta[check_1]" value="True" <?php if( get_post_meta( $car->ID, 'check_1', true ) == "True" ) {?>checked<?php}?> />
it give me an error that says
unexpected end of file
and tried it out it something abou the {?>checked<?php}?> that does not work
Forum: Fixing WordPress
In reply to: Custom Meta Box Checkbox not printingi tryed your code and it gives me text fields and text fields are not my problem, its that i need it to be check boxes and how to see if its true or false on my single.php page.
here is what i get with your code.
Forum: Fixing WordPress
In reply to: Custom Meta Box Checkbox not printingi might have forgotten to say that my code is my function.php file. but gonna try that code
Forum: Plugins
In reply to: [Polylang] Polylang removes my wrapper when i switch languagei solved it my self