kelligirl Posted June 2, 2013 Share Posted June 2, 2013 Hi all... First, as I stated, I'm a complete php novice, so excuse my elementary approach to my question. Here goes... I have price packages set up for placing a listing on my site which uses the code below to display them like so: $uri = end(explode('?', $_SERVER['REQUEST_URI'])); $uri = explode('&pkg=', $uri); //echo $uri[0]; $property_price_info = get_property_price_info(); if($property_price_info) { ?> <div class="form_row clearfix <?php if($_REQUEST['upgrade']){echo 'upgrade_highlight';} ?>" > <?php get_price_info($price_select,$package_pid,$uri[0]);?> </div> However, I want to be able to style the output to make it look like the image below, but I have no idea how to go about doing so. I'm not concerned with the verbiage difference (I just made an example to show you), I just need help figuring out how to make package 1, 2 and 3 show up on one line, then 4, 5 and 6 on the next, then 7, 8 and 9 on the next, etc. so that I can style the rows differently. Thanks in advance for your help! Quote Link to comment https://forums.phpfreaks.com/topic/278686-novice-needs-coding-help/ Share on other sites More sharing options...
Jessica Posted June 2, 2013 Share Posted June 2, 2013 The code you've posted doesn't demonstrate anything to do with output. What you're asking is a very simple thing. Select your categories, then for each one list the three options. Zebra-striping is another easy concept, you can find tutorials for that by googling. Quote Link to comment https://forums.phpfreaks.com/topic/278686-novice-needs-coding-help/#findComment-1433692 Share on other sites More sharing options...
kelligirl Posted June 2, 2013 Author Share Posted June 2, 2013 As I stated, I'm just a novice...sorry! I believe THIS is the code that needs to be changed: function get_price_info($title='',$package_pid, $uri) { global $price_db_table_name,$wpdb; add_column_if_not_exist($price_db_table_name, 'sort_order'); $pricesql = "select * from $price_db_table_name where status=1 and post_type='listing' ORDER BY sort_order,pid"; $priceinfo = $wpdb->get_results($pricesql); if($title==''){$title=$package_pid;} if($priceinfo) { $counter=1; foreach($priceinfo as $priceinfoObj) { if(stripslashes($priceinfoObj->title_desc)) { ?> <div class="package"><input type="radio" value="<?php echo $priceinfoObj->pid;?>" <?php if($title==$priceinfoObj->pid ){ echo 'checked="checked"';}?> name="price_select" id="price_select<?php echo $counter ?>" onclick="window.location.href='<?php echo home_url();?>/?<?php echo $uri; ?>&pkg=<?php echo $priceinfoObj->pid;?>'+user_val" /> <?php echo stripslashes($priceinfoObj->title_desc);?></div> <?php }else { ?> <div class="package"><input type="radio" value="<?php echo $priceinfoObj->pid;?>" <?php if($title==$priceinfoObj->pid ){ echo 'checked="checked"';}?> name="price_select" id="price_select<?php echo $counter ?>" onclick="window.location.href='<?php echo home_url();?>/?<?php echo $uri; ?>&pkg=<?php echo $priceinfoObj->pid;?>'+user_val" /> <?php printf(__(PUBLISH_DAYS_TEXT),$priceinfoObj->title,$priceinfoObj->days,str_replace(' ','_',$priceinfoObj->title),$priceinfoObj->amount,get_currency_type());?></div> <?php } ?> <?php $counter++; } } } Does anyone know what I would change to show the first 3 entries in a row, then the next 3, and so on instead of one per line? I have no idea whatsoever and REALLY, REALLY need some help... Thanks to everyone in advance!!! Quote Link to comment https://forums.phpfreaks.com/topic/278686-novice-needs-coding-help/#findComment-1433719 Share on other sites More sharing options...
Jessica Posted June 3, 2013 Share Posted June 3, 2013 Select your categories, then for each one list the three options. Quote Link to comment https://forums.phpfreaks.com/topic/278686-novice-needs-coding-help/#findComment-1433728 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.