Skip to:
Content
Pages
Categories
Search
Top
Bottom

Hide field in loop but still display label


  • njones7
    Participant

    @njones7

    Title is a bit vague sorry,

    In my profile loop i have a mobile number field in which is partially hidden, unfortunately it is showing up twice (since its being called in the while loop and ive echoed it), just wondering how to not show the one in the while loop but still display it in the table with the rest of the data.

    Here is a link for better reference (not an actual mobile number), i need to not show the top one in the loop.
    http://tinypic.com/r/2gwc4kl/9

    Buddypress: 2.9.1
    Wordpress: 4.8.2

Viewing 1 replies (of 1 total)

  • njones7
    Participant

    @njones7

    Probably should also this is what my code looks like for that

    <td class="data"><?php 
    
    bp_the_profile_field_value();if(23 == bp_get_the_profile_field_id()) {
    $phonenum = xprofile_get_field_data("Mobile Number");
    
    $first_part = substr(preg_replace( '/\s+/', '', $phonenum ), 0,-4);
    				$hidden_part = substr(preg_replace( '/\s+/', '', $phonenum ),strlen($first_part));
    				?>
    				<div style="cursor:pointer;"id="hidden-number" data-last="<?php echo $hidden_part;?>"><?php echo $first_part;?><span></span></div>
    				<?php
    			 }?>								
    				</td>
    
Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.
Skip to toolbar