Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $args = array(
- 'post_type' => 'hus',
- 'post_status' => 'publish',
- 'posts_per_page' => 10,
- );
- $loop = new WP_Query( $args );
- $current_user_id = get_current_user_id();
- $acf_user = get_field( 'user' );
- ?>
- <div id="primary" class="content-area">
- <main id="main" class="site-main">
- <?php
- if ( is_user_logged_in() && $current_user_id === $acf_user || current_user_can( 'administrator' ) ) {
- while ( $loop->have_posts() ) : $loop->the_post();
- the_title();
- the_content();
- print_r($post->ID);
- endwhile;
- wp_reset_postdata();
- } else {
- echo "<span>Du har inte behörighet att visa denna sida.</span>";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement