Forum Replies Created

Viewing 2 replies - 16 through 17 (of 17 total)
  • Thread Starter Lineone

    (@lineone)

    I need to remove from non-Administrators i.e. Guest Bloggers (the distraction of seeing) links to add new call to Action, Leads etc. In the absence of another simple way to achieve this, am using CSS to hide the links in conjunction with a function created by AppThemes to check if a logged in user has the Administrator role.

    Thread Starter Lineone

    (@lineone)

    Yes. That seems to have done the trick.

    The (simplified) code in question is now:

    <?php
    $args = array(
    	'cat' => 13,
    	'posts_per_page' => 1,
    	'order' => 'DESC'
    );
    
    // The Query
    $the_query = new WP_Query( $args );
    remove_filter('posts_where', 'filter_where');
    
    // The Loop
    if ( $the_query->have_posts() ) { ?>
    	<ul>
    	<?php
    	while ( $the_query->have_posts() ) {
    	$the_query->the_post(); ?>
    	<li>
    		<a href="<?php echo get_the_permalink() ?>"><h3><?php echo get_the_title() ?></h3></a>
    		<?php echo lyte_parse(do_shortcode(get_the_content())) ?>
    	</li>
        <?php
    } ?>
    </ul>
    <?php
    } else {
    	// no posts found
    } 
    
    /* Restore original Post Data */
    wp_reset_postdata();
    ?>

    Many thanks Frank

Viewing 2 replies - 16 through 17 (of 17 total)