Monday, 15 April 2013

function - string inside div -



function - string inside div -

need coding advice, want combine 2 different wordpress functions, begin in $string , homecoming codes.

the return code is

return '<div> html </div>';

the $sting code is

$string .= '<div>'; if else $string .= '</div>';

thanks

well dont have experience in coding , html..

1st function

<?php function _bit_header_inside(){ /* header logo + banner */ global $wpdb,$ppt; homecoming '<div id="header" class="full"><div class="w_960"> <div class="f_half left" id="logo"> <a href="'.$globals['bloginfo_url'].'/" title="'.get_bloginfo('name').'"> <img src="'.$ppt->logo(true).'" alt="'.get_bloginfo('name').'" /> </a> </div> <div class="left" id="banner"> '.test_banner("top",true).' </div> </div> <!-- end header w_960 --> <div class="clearfix"></div> </div> <!-- end header -->'; } ?> <?php echo test_header_inside(_bit_header_inside()); /* hook / filter */ ?>

2nd function

<?php function custom_login_logout(){ /* custom login-logout bar */ global $wpdb,$ppt, $userdata; get_currentuserinfo(); $string=''; $string .= '<div id="submenubar"><div class="w_960">'; if(isset($globals['ppt_layout_styles']['header']) && isset($globals['ppt_layout_styles']['header']['loginlogout']) && $globals['ppt_layout_styles']['header']['loginlogout'] == 1){ }else{ $string .= '<ul class="submenu_account">'; if ( isset($userdata) && $userdata->id ){ $string .= '<li id="submenu_li_logout"><a href="'.wp_logout_url().'">'.$ppt->_e(array('head','4')).'</a></li> <li id="submenu_li_account"><a href="'.$globals['test']['dashboard_url'].'">'.$ppt->_e(array('head','5')).'</a></li> <li id="submenu_li_username"><b>'.$userdata->display_name.'</b></li>'; }else{ $string .= '<li><a href="'.$globals['bloginfo_url'].'/wp-login.php" rel="nofollow" id="submenu_li_login">'. $ppt->_e(array('head','6')).'</a> <a href="'.$globals['bloginfo_url'].'/wp-login.php?action=register" rel="nofollow" id="submenu_li_register">'.$ppt->_e(array('head','7')).'</a></li>'; } $string .= '</ul> '; } $string .= '</div> <!-- end w_960 --> </div><!-- end submenubar --> '; homecoming $string; } ?> <?php echo test_submenu_inside(custom_login_logout()); /* hook / filter */ ?>

how insert "custom_login_logout" within "test_header_inside" below

<div class="left" id="banner"> '.test_banner("top",true).' </div>

can combine them way

<?php homecoming '<div> html'; $string .= '<div>'; if else $string .= '</div>'; homecoming '</div>'; ?> <?php echo test_header_inside(_bit_header_inside()); /* hook / filter */ ?>

thanks

string function return

No comments:

Post a Comment