Advertisement
marjwyatt

snippet from guide-portal code

May 21st, 2012
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.12 KB | None | 0 0
  1. <?php
  2. //return all adventures for current user
  3. //snippet from guide-portal.php
  4.  $this_id = get_current_user_id();
  5.  $author_id = $this_id;
  6.  $args=array(
  7.   'author' => $author_id,
  8.   'post_type' => 'guides',
  9.   'post_status' => 'publish',
  10.   'posts_per_page' => -1,
  11.   'caller_get_posts'=> 1
  12.  );
  13.  $my_query = null;
  14.  $my_query = new WP_Query($args);
  15.  if( $my_query->have_posts() ) {
  16.   echo '<h2>List of Your Guide Profiles</h2>';
  17.   while ($my_query->have_posts()) : $my_query->the_post(); ?>
  18.   <p style="padding-left: 20px; font-size: 16px;"><b><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></b><form class="edit-listing" action="http://sherpademo.co.cc/voodoo-form/" method="post"> <?php /* the url of the "sherpa-edit-guide.php" */ ?><input type="hidden" id="postid" name="postid" value="<?php the_ID(); ?>" /> <?php /* get the post ID into "postid" and later pass it to "sherpa-edit-guide.php" */ ?><input type="submit"  value="Edit" /></form></p>
  19. <?php
  20.  endwhile;
  21. }
  22. wp_reset_query();  // Restore global post data stomped by the_post().
  23. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement