Forum Replies Created

Viewing 15 replies - 1 through 15 (of 20 total)
  • Thread Starter Marta86

    (@marta86)

    I’ve seen that plugin, but when I install it it asks to save all the data and backup databases. I can copy all website’s files, but I don’t know how to backup databases because I can’t access to them.

    How can I do that?

    Thanks!

    Thread Starter Marta86

    (@marta86)

    Thank you so much! I’ll try it 😀

    Thread Starter Marta86

    (@marta86)

    No one to help?

    Thread Starter Marta86

    (@marta86)

    No one to help?

    I have the same issue.

    When I see my website in another resolution, homepage is being cut-off and I don’t have a vertical scrolling, as it is on the other pages.

    How can I re-size the whole page so everyone can see it properly?

    Thread Starter Marta86

    (@marta86)

    Now it’s perfect! Thank you so much! You saved my life! 🙂

    Thread Starter Marta86

    (@marta86)

    That works 🙂 But for some reason, the link to author page doesn’t work when I put into the variable.

    Thread Starter Marta86

    (@marta86)

    By the way, as you’re so kind, can you help with one more thing?

    I want to create an else that shows “no Members yet” if there’s no user with the conditions defined on the if loop.

    I’ve written:

    if(strtolower($fileira) == strtolower($current_category_name)) {
     //if the fileira custom field value is the same as category name
    //the users with current category ID/name on fileira custom field should appear
    
    //echo "<li>"."<a href=\"".get_bloginfo('url')."/?author=".$author->ID."\">".get_avatar($author->ID)."</a>";
    echo "<ul><a href=\"".get_bloginfo('url')."/?author=".$author->ID."\">";
    $nomi = the_author_meta('display_name', $author->ID);
    echo "</a></ul>";
    }

    And now I want an else:

    else {
    echo "no members yet";
    }

    Is there a reason to, with this code, the “no members” being shown, despite of having users to show?

    Thread Starter Marta86

    (@marta86)

    I’ve been thinking about that, but I’m not the boss, I must talk first with the company 🙂

    Thread Starter Marta86

    (@marta86)

    Oh my god, at first glance, it works!! 🙂

    Thank you so much 😀

    The problem was on creating the custom field?

    Thread Starter Marta86

    (@marta86)

    The Fileira custom field is a text field

    <tr>
    	<th><label for="fileira"><?php _e('Fileira'); ?></label></th>
    	<td><input type="text" name="fileira" id="fileira" value="<?php echo esc_attr($profileuser->fileira) ?>" class="regular-text" /></td>
    </tr>

    So the user can write whatever they want.

    The categories are: Fish, Meat, Wine, Cereals, Honey, Vegetables, Olive Oil and Milk.

    So what I want is if a user is on a category page (eg. Fish), he/she can see all users that “belong” to that category, by getting the value of Fileira custom field and comparing it with the category name of the current page and, if it’s the same, appears avatar and name of those users.

    I get all users, than the custom field value and the current category, but when I’m comparing them, the if doesn’t work.

    Thread Starter Marta86

    (@marta86)

    Problem persists 🙁

    If I write echo $fileira; and echo $$current_category_name, the first shows all values in that field and the second show the right category name.

    But when I want to compare, it jumps to the else “echo ‘no'”;

    So the comparison is wrong, but I don’t know the right code :/

    When I put the code inside the if loop, outside it,

    $fileira = get_the_author_meta('fileira', $author->ID); //get the value of fileira custom field
    
    echo "<li>"."<a href=\"".get_bloginfo('url')."/?author=".$author->ID."\">".get_avatar($author->ID)."</a>";
    echo '<div>'."<a href=\"".get_bloginfo('url')."/?author=".$author->ID."\">".the_author_meta('display_name', $author->ID)."</a>"."</div>"."</li>";
    echo '<div>'.$fileira."</div>"."</li>";

    I get all the users with the avatar, name and the fileira field value, but the “no” of the else is always showing up.

    else { //if it's empty
    echo "no";
    }

    Thread Starter Marta86

    (@marta86)

    But as category name as fileira custom field value usually have a capital letter. That code won’t work, am I right?

    I’ve tried and it appears the value of all custom field with the else option (if it’s not the same, it appears “no”):

    “VinhononoCereaisnoCarnenoVinhononoGestão e AvaliaçãonononoCereaisno”

    Sorry, it shouldn’t be $user_last, but $fileira;

    function contributors() {
    global $wpdb;
    $authors = $wpdb->get_results("SELECT ID, user_nicename from $wpdb->users ORDER BY display_name"); //Go get all users
    
     $current_category =  get_query_var('cat');
    // to then get the cat name
    $current_category_name = get_cat_name( $current_category);
    
    foreach($authors as $author) { 
    
     $fileira = the_author_meta('fileira', $author->ID); //get the value of fileira custom field
    
    if(strtolower($fileira) == strtolower($current_category_name)) {
     //if the fileira custom field value is the same as category name
    //the users with current category ID/name on fileira custom field should appear
    
    echo "<li>"."<a href=\"".get_bloginfo('url')."/?author=".$author->ID."\">".get_avatar($author->ID)."</a>";
    echo '<div>'."<a href=\"".get_bloginfo('url')."/?author=".$author->ID."\">".the_author_meta('display_name', $author->ID)."</a>"."</div>"."</li>";
    echo '<div>'.$fileira."</div>"."</li>"; //show fileira value
    }
    
    else { //if it's empty
    //the users without the current category name should not appear
    echo "no";
    }
    
    }
    }
    
    contributors();
    Thread Starter Marta86

    (@marta86)

    What’s wrong?

    Thread Starter Marta86

    (@marta86)

    That gave me the category name, but my problem isnt’ solved yet 🙁

    I’m trying show all users’ name and avatar that have the category name in fileira custom field value. I’m trying to compare category name with custom field value but something is wrong 🙁

    This is the code:

    function contributors() {
    global $wpdb;
    $authors = $wpdb->get_results("SELECT ID, user_nicename from $wpdb->users ORDER BY display_name"); //Go get all users
    
     $current_category =  get_query_var('cat');
    // to then get the cat name
    $current_category_name = get_cat_name( $current_category);
    
    foreach($authors as $author) { 
    
     $fileira = the_author_meta('fileira', $author->ID); //get the value of fileira custom field
    
    if(in_array($user_last, $current_category_name)) { //if the fileira custom field value is the same as category name
    //the users with current category ID/name on fileira custom field should appear
    
    echo "<li>"."<a href=\"".get_bloginfo('url')."/?author=".$author->ID."\">".get_avatar($author->ID)."</a>";
    echo '<div>'."<a href=\"".get_bloginfo('url')."/?author=".$author->ID."\">".the_author_meta('display_name', $author->ID)."</a>"."</div>"."</li>";
    echo '<div>'.$fileira."</div>"."</li>"; //show fileira value
    }
    
    else { //if it's empty
    //the users without the current category name should not appear	
    
    }
    
    }
    }
    
    contributors();

Viewing 15 replies - 1 through 15 (of 20 total)