HEX
HEX
Server: Apache
System: Linux localhost.localdomain 4.18.0-348.7.1.el8_5.x86_64 #1 SMP Wed Dec 22 13:25:12 UTC 2021 x86_64
User: www (1001)
PHP: 8.1.32
Disabled: passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
Upload Files
File: /www/wwwroot/ahmsolaiman.com/wp-content/plugins/types/examples/author.php
<?php
/**
 * This example file is a part of the Types plugin online documentation found at: https://toolset.com/documentation/customizing-sites-using-php/
 * It is based on the original Twenty Sixteen theme's archive.php file.
 * It features additional code to render custom user fields created with the Types plugin.
 *
 * Please note that the names of the custom fields are for example purposes only and will not work in your site as-is. You need to edit this example according to the documentation mentioned above.
 *
 * The template for displaying custom author archive pages
 *
 *
 * @package WordPress
 * @subpackage Twenty_Sixteen
 * @since Twenty Sixteen 1.0
 */

get_header(); ?>

	<div id="primary" class="content-area">
		<main id="main" class="site-main" role="main">

		<?php if ( have_posts() ) : ?>

			<header class="page-header">
<!-- TYPES TIP: using get_the_author_meta function to output author name as the archive's title -->
			<?php
					echo '<h1 class="page-title">Author: ' . get_the_author_meta( 'first_name' ) . ' ' . get_the_author_meta( 'last_name' ) . '</h1>';
				?>

<!-- TYPES TIP: using get_avatar function to output author's avatar image -->						
				<div class="user-avatar"><?php echo get_avatar( get_the_author_meta( 'user_email' ), '150' ); ?></div>
				
<!-- TYPES TIP: using Types function to custom user fields -->		
				<p><strong>Specialty topics:</strong> <?php echo types_render_usermeta( "specialty-topics" ); ?><br />
				<strong>Staff role:</strong> <?php echo types_render_usermeta( "staff-role" ); ?></p>

<!-- TYPES TIP: using the the_author_meta function to output the description of the user -->						
				<p><b>About:</b> <?php the_author_meta( 'description' ); ?></p>
				
				</header><!-- .page-header -->
				
			<hr />

			
<!-- TYPES TIP: Creating a custom query for our author/user to display posts belonging to the "Post" and "Book" post types -->			
			<?php
			// Add Custom Post Type to author archive
			$args = array(
				'post_type' => array('post', 'book') ,
				'author' => get_queried_object_id(), // this will be the author ID on the author page
				'showposts' => 10
			);
			$custom_posts = new WP_Query( $args );
			
			// Start the Loop.
			while ( $custom_posts->have_posts() ) : $custom_posts->the_post();
				
				/*
				 * Include the Post-Format-specific template for the content.
				 * If you want to override this in a child theme, then include a file
				 * called content-___.php (where ___ is the Post Format name) and that will be used instead.
				 */
				
				get_template_part( 'template-parts/content', get_post_type() );
				
			// End the loop.
			endwhile;

			// Previous/next page navigation.
			the_posts_pagination( array(
				'prev_text'          => __( 'Previous page', 'wpcf' ),
				'next_text'          => __( 'Next page', 'wpcf' ),
				'before_page_number' => '<span class="meta-nav screen-reader-text">' . __( 'Page', 'wpcf' ) . ' </span>',
			) );

		// If no content, include the "No posts found" template.
		else :
			

		endif;
		?>

		</main><!-- .site-main -->
	</div><!-- .content-area -->

<?php get_sidebar(); ?>
<?php get_footer(); ?>