Forum Replies Created

Viewing 15 replies - 31 through 45 (of 112 total)
  • Thread Starter kokoruz

    (@kokoruz)

    Thank You

    Thread Starter kokoruz

    (@kokoruz)

    Related but not related but I’m hoping you can help. I am hoping to show taxonomy terms for just the role “resource” but it displays the taxonomy for every term that has been assigned to a user. I’ve tried wp_list_categories, get_terms and WP_Term_Query. I can’t find a way to only render the terms for a specific role. If you can provide some insight I would appreciate it. I did go back and rewrite my other content based on your get_users link. Thank you for that.

    <?php
    $service_terms_args = array(
        'taxonomy'      => 'service',
        'order'         => 'ASC',
        'orderby'       => 'name',
        'hide_empty'    => true,
        );
        $service_terms_query = new WP_Term_Query( $service_terms_args );
            if (!empty( $service_terms_query ) ) {
                echo '<p><span class="label">Services:</span><span class="data">';
                    if (!is_wp_error( $service_terms_query ) ) {
                        echo '<ul>';
                            foreach( $service_terms_query->get_terms() as $service_term ) {
                                echo '<li><a href="' . get_term_link( $service_term->slug, 'service' ) . '">' . esc_html( $service_term->name ) . '</a></li>'; 
                            } 
                        echo '</ul>';
                    }
            }
    ?>
    Thread Starter kokoruz

    (@kokoruz)

    I have adjust me code. Everything looks like it is working well.

    $service_terms = wp_get_object_terms(  $user->ID, 'service' );
    if ( ! empty( $service_terms ) ) {
        echo '<p><span class="label">Services:</span><span class="data">';
    	if ( ! is_wp_error( $service_terms ) ) {
    		echo '<ul>';
    			foreach( $service_terms as $service_term ) {
    				echo '<li><a href="' . get_term_link( $service_term->slug, 'service' ) . '">' . esc_html( $service_term->name ) . '</a></li>'; 
    			}
    		echo '</ul>';
    	}
    }

    Thank You

    Thread Starter kokoruz

    (@kokoruz)

    I pasted the JSON but it looks like it was flagged. I posted the file so you could download it.

    This link has the same JSON but it is wrapped in a zip file.

    https://reel.io/__qvzQU

    • This reply was modified 5 years, 10 months ago by kokoruz.
    • This reply was modified 5 years, 10 months ago by kokoruz.
    Thread Starter kokoruz

    (@kokoruz)

    <div class="row profile profile-list">
    <div class="col-sm-12">                        
    <?php
    $term_id = get_queried_object_id();
    $term = get_queried_object();
    $users = get_objects_in_term( $term_id, $term->taxonomy );
    $desc = $term->description;   
    echo '<p>' . $desc . '</p>';
    
    if ( !empty( $users ) ) {
    echo '<div class="row equal">';
    foreach ( $users as $user_id ) {    
    echo '<div class="col-sm-3 d-flex"><div class="card bg-dark"><div class="card-body">';
    $nicename = get_the_author_meta('user_nicename', $user_id);   
    $f_name = get_the_author_meta('first_name', $user_id);
    $l_name = get_the_author_meta('last_name', $user_id);
    $mobile = get_the_author_meta('cell_phone', $user_id); 
    $office_phone = get_the_author_meta('office_phone', $user_id);
    $office_ext = get_the_author_meta('office_ext', $user_id);
    $email_address = get_the_author_meta('user_email', $user_id);
    $google_plus = get_the_author_meta('googleplus', $user_id);
    $twitter = get_the_author_meta('twitter', $user_id);
    $facebook = get_the_author_meta('facebook', $user_id);
    $instagram = get_the_author_meta('instagram', $user_id);
    $linkedin = get_the_author_meta('linkedin', $user_id);
    $facebook = get_the_author_meta('facebook', $user_id);
    $youtube = get_the_author_meta('youtube', $user_id);
    echo '<img class="img-thumbnail" src="' . esc_url( get_avatar_url( $user_id, array("size"=>150) ) ) . '" />'; /*get_avatar_url*/
    $badge = get_field('user_profile_photo', 'user_' . $user_id);
    echo '<p><span class="label">Name:</span><span class="data">' . $f_name . ' ' . $l_name . '</span></p>';
    echo '<p><span class="label">Email:</span><span class="data"><a href="mailto:' . $email_address . '">' . $email_address . '</a></span></p>';
    
    if (!empty($mobile)) { echo '<p><span class="label">Cell Phone:</span><span class="data">' . $mobile . '</span></p>'; };
    if (!empty($office_phone) || !empty($office_ext)) { echo '<p><span class="label">Office Phone:</span><span class="data">' . $office_phone . ' x' . $office_ext . '</span></p>'; };
    if (!empty($google_plus)) { echo '<span class="data-icon"><a target="_blank" href="' . $google_plus . '"><i class="fab fa-google-plus-square"></i></a></span>'; };
    if (!empty($twitter)) { echo '<span class="data-icon"><a target="_blank" href="https://twitter.com/' . $twitter . '"><i class="fab fa-twitter"></i></a></span>'; };
    if (!empty($facebook)) { echo '<span class="data-icon"><a target="_blank" href="' . $facebook . '"><i class="fab fa-facebook-square"></i></a></span>'; };
    if (!empty($youtube)) { echo '<span class="data-icon"><a target="_blank" href="' . $youtube . '"><i class="fab fa-youtube"></i></a></span>'; };
    if (!empty($instagram)) { echo '<span class="data-icon"><a target="_blank" href="' . $instagram . '"><i class="fab fa-instagram"></i></a></span>'; };
    if (!empty($linkedin)) { echo '<span class="data-icon"><a target="_blank" href="' . $linkedin . '"><i class="fab fa-linkedin"></i></a></span>'; };
            
    echo '<div class="profile-btn"><a class="btn btn-light btn-sm" href="/profile-page/user/index.php?user=' . $nicename .'">View User Profile</a></div>';   
    echo '</div></div></div>';
    }
    echo '</div>'; ?>
    <?php } ?>
    </div>
    </div>
    Thread Starter kokoruz

    (@kokoruz)

    Thanks for the update. Not sure I can explain why but Monday when I got back to work on this everything seemed to be working correctly but I appreciate the response and the wp_get_object_terms code.

    Thread Starter kokoruz

    (@kokoruz)

    I wound up adding the following code to the top of my header.php file because the visitor role would not react to any of the selections in the plugin. It’s like they didn’t even exist.
    <?php if ( !is_user_logged_in() ) { auth_redirect(); } ?>

    I even tried disabling all my plugins but AAM. I switched themes to one of the default themes that came with wordpress as well to eliminate a functions.php issue.

    Nothing would get the Visitor role to redirect to the login page until I hard coded the line above.

    The real head scratcher is the plugin works just fine on another site that I use it for. Wish I could understand why. The settings are identical. Same server and same php (7.3.5)

    Thread Starter kokoruz

    (@kokoruz)

    I believe I solved this. I assigned capabilities to each unique role based on the taxonomy name, and now the terms can be edited or manged based on their assignments. Thanks Again!

        'capabilities'  => array(
            'manage_terms'              => 'edit_client',
            'edit_terms'                => 'edit_client',
            'delete_terms'              => 'edit_client',
            'assign_terms'              => 'edit_client',
        ),
    Thread Starter kokoruz

    (@kokoruz)

    Perfect timing.

    Couple questions. I have added the following code and toggling between ‘read’ and ‘edit_users’ allows me to show or hide the taxonomy for that user. They can’t add or delete a term (which is perfect) but they can select from the list of terms provided.

        'capabilities'  => array(
            'manage_terms'              =>'edit_users',
            'edit_terms'                =>'edit_users',
            'delete_terms'              =>'edit_users',
            'assign_terms'              =>'read',
        ),

    I have two roles, Subscriber and SubcriberPlus. With those two roles each has a unique taxonomy of terms. With the capabilities I can hide it or display it now which is perfect for the admin to manage for the users but if I want to have the user see/select the taxonomy of terms related to their role is that possible. I’m currently reading about capabilities but would love to hear back from you as the author for your feeback. Thank You.

    Thread Starter kokoruz

    (@kokoruz)

    POST 1 (EVERYONE)
    POST 2 (EVERYONE)
    POST 3 (LIMITED)
    POST 4 (EVERYONE)
    POST 5 (EVERYONE)

    When I query my posts, I’d rather that POST 3 (LIMITED) not be visible if I’m not (EVERYONE). Right now if I’m (EVERYONE) I still see the title POST 3. If I click the link it redirects me. I don’t want people to see some posts.

    Thread Starter kokoruz

    (@kokoruz)

    Thread Starter kokoruz

    (@kokoruz)

    Thanks Ed, I read that on the site but wasn’t sure if it meant completely or if aspects of the shortcodes we limited but the display options. Good to know. Could you perhaps point me in a direction on using wp_query to display the content in a list view.

    Thread Starter kokoruz

    (@kokoruz)

    I guess another way of asking is what is the Events Category actual taxonomy name so I can register that taxonomy with posts

    • This reply was modified 6 years, 6 months ago by kokoruz.
    Thread Starter kokoruz

    (@kokoruz)

    Thanks for the fast reply.

    I do not see these custom fields listed even thoough I do have the Yoast SEO Installed
    https://haod.exclaim-inc.info/wp-content/uploads/search.png

    As for the attachments. Is it possible to only search the titles of some of the files like PDF and DOC and to ignore jpgs? Also does it search the file name or the title of the post in the media Library.

    Thank You Again!

    Thread Starter kokoruz

    (@kokoruz)

    clearing the log fixed the issue. thanks for you help with this.

Viewing 15 replies - 31 through 45 (of 112 total)