Advertisement
Guest User

Untitled

a guest
Feb 23rd, 2017
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. if ( ! function_exists( 'x_excerpt_string' ) ) :
  2. function x_excerpt_string( $more ) {
  3. if (is_user_logged_in()) {
  4. return ' <div><a href="' . get_permalink() . '" class="more-link">' . __( 'Read More', '__x__' ) . '</a></div>';
  5. }
  6. else {
  7. return '<div><a class="more-link" href="' . wp_login_url(get_permalink()) . '">Log in to read more</a></div>';
  8. }
  9. }
  10. add_filter( 'excerpt_more', 'x_excerpt_string' );
  11. endif;
  12.  
  13. if (is_user_logged_in()) {
  14. query_posts( 'orderby=rand&posts_per_page=1&post_type=card&cat=9' );
  15. }
  16. else {
  17. query_posts( 'orderby=rand&posts_per_page=1&post_type=card&cat=8' );
  18. }
  19.  
  20. <?php if (!is_user_logged_in()) { echo '
  21. <p>To get access to the whole card deck along with follow-up exercices, please <a href="' . wp_login_url(get_permalink()) . '">log in.</a> If you are not a member, <a href="/members">register for free</a>.'; } ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement