Title: mrspabs's Replies | WordPress.org

---

# mrspabs

  [  ](https://wordpress.org/support/users/mrspabs/)

 *   [Profile](https://wordpress.org/support/users/mrspabs/)
 *   [Topics Started](https://wordpress.org/support/users/mrspabs/topics/)
 *   [Replies Created](https://wordpress.org/support/users/mrspabs/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/mrspabs/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/mrspabs/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/mrspabs/engagements/)
 *   [Favorites](https://wordpress.org/support/users/mrspabs/favorites/)

 Search replies:

## Forum Replies Created

Viewing 15 replies - 1 through 15 (of 44 total)

1 [2](https://wordpress.org/support/users/mrspabs/replies/page/2/?output_format=md)
[3](https://wordpress.org/support/users/mrspabs/replies/page/3/?output_format=md)
[→](https://wordpress.org/support/users/mrspabs/replies/page/2/?output_format=md)

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[The Pack Elementor addon] how to remove](https://wordpress.org/support/topic/how-to-remove-45/)
 *  Thread Starter [mrspabs](https://wordpress.org/support/users/mrspabs/)
 * (@mrspabs)
 * [3 years, 8 months ago](https://wordpress.org/support/topic/how-to-remove-45/#post-16161451)
 * nevermind. i was able to remove it the normal way.
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [limit the number of times a subscriber can login](https://wordpress.org/support/topic/limit-the-number-of-times-a-subscriber-can-login/)
 *  Thread Starter [mrspabs](https://wordpress.org/support/users/mrspabs/)
 * (@mrspabs)
 * [7 years, 3 months ago](https://wordpress.org/support/topic/limit-the-number-of-times-a-subscriber-can-login/#post-11339830)
 * Looks like Advanced Access Manager does what I need. Just posting the answer 
   here in case someone else needs it.
 * [https://aamplugin.com/article/how-to-create-temporary-wordpress-user-account](https://aamplugin.com/article/how-to-create-temporary-wordpress-user-account)
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Meta.php and problems with memory](https://wordpress.org/support/topic/meta-php-and-problems-with-memory/)
 *  Thread Starter [mrspabs](https://wordpress.org/support/users/mrspabs/)
 * (@mrspabs)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/meta-php-and-problems-with-memory/#post-10091765)
 * Thanks
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Ultimate WP Query Search Filter] Searching by date range](https://wordpress.org/support/topic/searching-by-date-range/)
 *  [mrspabs](https://wordpress.org/support/users/mrspabs/)
 * (@mrspabs)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/searching-by-date-range/#post-9157883)
 * Thank you for this code, here is my adaptation of it!
 *     ```
       add_action('uwpqsf_form_bottom','insert_date_input');
       function insert_date_input($attr){
       		$html = '<div class="uwpqsf_class"><span class="taxolabel-2">Date Range</span>';
       		$html .= '<div><label><span style="display:block;">From </span> <select class="monthsearch" name="date[from-month]">   <option value="">--Select Month--</option><option  value="1">Janaury</option><option value="2">February</option><option value="3">March</option><option value="4">April</option><option value="5">May</option><option value="6">June</option><option value="7">July</option><option value="8">August</option><option value="9">September</option><option value="10">October</option><option value="11">November</option><option value="12">December</option></select>  <input name="date[from-year]" size="4" value="" class="yearsearch" type="text" placeholder="YYYY"></label></div>';//you can use select or other input type
       		$html .='</div>';
       		$html .= '<div class="uwpqsf_class">';
       		$html .= '<div><label> <span style="display:block;">To </span> <select class="monthsearch" name="date[to-month]">   <option value="">--Select Month--</option><option  value="1">Janaury</option><option value="2">February</option><option value="3">March</option><option value="4">April</option><option value="5">May</option><option value="6">June</option><option value="7">July</option><option value="8">August</option><option value="9">September</option><option value="10">October</option><option value="11">November</option><option value="12">December</option></select> <input name="date[to-year]" value="" class="yearsearch" type="text" placeholder="YYYY"></label></div>';
       		$html .='</div>';
       		echo $html;
       }
   
       add_filter('uwpqsf_deftemp_query','insert_date_to_query','',3);
       function insert_date_to_query($args,$id,$getdata){
   
       	 $args['date_query'] = array(
       		  'after'     => array(
       				'year' => $getdata['date']['from-year'],
       				'month' => $getdata['date']['from-month'],
       				'day' => '1'
       		  ),
       		  'before'    =>  array(
       				'year' => $getdata['date']['to-year'],
       				'month' => $getdata['date']['to-month'],
       				'day' => '31'
       		  ),
       		  'inclusive' => true
       	 );
   
       return $args;
       }
       ```
   
 * ![Filters](https://i0.wp.com/i63.tinypic.com/2pzb1hf.jpg)
 * how do i get it to show what the user searched for in the search results. is 
   there is way to get the “value” and “selected” to update on the search result
   page?
    -  This reply was modified 9 years, 1 month ago by [mrspabs](https://wordpress.org/support/users/mrspabs/).
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[User Groups] other main menu for people who belong to group X](https://wordpress.org/support/topic/other-main-menu-for-people-who-belong-to-group-x/)
 *  [mrspabs](https://wordpress.org/support/users/mrspabs/)
 * (@mrspabs)
 * [9 years, 10 months ago](https://wordpress.org/support/topic/other-main-menu-for-people-who-belong-to-group-x/#post-8175645)
 * Did you ever figure out how?
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [thumbnail as background image with fallback](https://wordpress.org/support/topic/thumbnail-as-background-image-with-fallback/)
 *  Thread Starter [mrspabs](https://wordpress.org/support/users/mrspabs/)
 * (@mrspabs)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/thumbnail-as-background-image-with-fallback/#post-7349159)
 * Figured it out
 * <div style=”background: url(<?php
    if ( ” != get_the_post_thumbnail() ) { the_post_thumbnail_url(‘
   custom’); } else { echo get_bloginfo( ‘stylesheet_directory’ ) . ‘/img/blog-placeholder.
   jpg’; } ?> ); background-size:cover; background-position:cover;”>
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Get the title and featured image via post id](https://wordpress.org/support/topic/get-the-title-and-featured-image-via-post-id/)
 *  Thread Starter [mrspabs](https://wordpress.org/support/users/mrspabs/)
 * (@mrspabs)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/get-the-title-and-featured-image-via-post-id/#post-7228286)
 * Thanks! That helped a lot. I was able to write it like this and it works.
 *     ```
       <?php
       global $post;
       $cat_ID=array();
       $categories = get_the_category(); //get all categories for this post
         foreach($categories as $category) {
           array_push($cat_ID,$category->cat_ID);
         }
         $args = array(
         'orderby' => 'date',
         'order' => 'DESC',
       	'post_type' => 'post',
       	'numberposts' => 8,
       	'post__not_in' => array($post->ID),
       	'category__in' => $cat_ID
         ); // post__not_in will exclude the post we are displaying
           $cat_posts = get_posts($args);
       if ($cat_posts) {
         foreach ($cat_posts as $cat_post) {
           ?>
           <div class="col-md-3 text-center">
        <a href="<?php echo get_permalink($cat_post->ID); ?>">  <?php echo get_the_post_thumbnail( $cat_post->ID, 'medium' ); ?><br>
        <?php echo get_the_title($cat_post->ID); ?></a>
        </div><!--// col-md-3 -->
       <?php $counter++; if ($counter % 4 == 0) { echo '</div><div class="row">'; } ?>
           <?php
         }
       }
       ?>
       ```
   
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Custom Field Suite] Adding Select Field To the Loop](https://wordpress.org/support/topic/adding-select-field-to-the-loop/)
 *  [mrspabs](https://wordpress.org/support/users/mrspabs/)
 * (@mrspabs)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/adding-select-field-to-the-loop/#post-6604809)
 * Just posting the resolution here for anyone else who needs it.
 *     ```
       <?php
       /*
           A loop field named "gallery" with sub-fields "slide_title", "upload" and a select called file_type.
       */
       $fields = CFS()->get('gallery');
       foreach ($fields as $field) {
           echo $field['slide_title'];
           echo $field['upload'];
           echo current($field[file_type]);
       }
       ?>
       ```
   
 * Since the select field “file_type” returns an array, using current will allow
   you to display the first item in the array.
 * This solution only works for a select box where only one item can be chosen.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Quick Page/Post Redirect Plugin] 301s keep defaulting back to 302s](https://wordpress.org/support/topic/301s-keep-defaulting-back-to-302s/)
 *  [mrspabs](https://wordpress.org/support/users/mrspabs/)
 * (@mrspabs)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/301s-keep-defaulting-back-to-302s/#post-6180807)
 * Hi Don. Just wanted to followup. Thanks again for your replies.
 * We changed the theme to Twenty Fifteen and we get the same error.
 * Urivalet is a cool site, when I use it, I see that my redirect is indeed a 301
   redirect even though the front end says 302. So I am think I am all set. Just
   thought you would want to know.
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [loop with the_query instead of query_posts – with pagination](https://wordpress.org/support/topic/loop-with-the_query-instead-of-query_posts/)
 *  Thread Starter [mrspabs](https://wordpress.org/support/users/mrspabs/)
 * (@mrspabs)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/loop-with-the_query-instead-of-query_posts/#post-5653446)
 * i think i figured it out. can someone confirm that I am right?
 *     ```
       <?php  $paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1;  ?>
       <?php $the_query = new WP_Query( array( 'posts_per_page' => 2, 'pagination' => true, )); ?>
       <?php if ( $the_query->have_posts() ) : ?>
       <?php while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
   
       <!-- stuff -->
   
       <?php endwhile; ?>
   
       <div class="nav-previous alignleft"><?php next_posts_link('Older posts', $the_query->max_num_pages ); ?></div>
       <div class="nav-next alignright"><?php previous_posts_link( 'Newer posts' ); ?></div>
       <?php else : ?>
       <p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
       <?php endif; ?>
       ```
   
 * The code works, but I want to be sure that its all written correctly since I 
   am trying to fix bad habits.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Regenerate Thumbnails] Where does it look for the images](https://wordpress.org/support/topic/where-does-it-look-for-the-images/)
 *  Thread Starter [mrspabs](https://wordpress.org/support/users/mrspabs/)
 * (@mrspabs)
 * [12 years ago](https://wordpress.org/support/topic/where-does-it-look-for-the-images/#post-5041921)
 * Oh i see what i did wrong
 * the table is _postmeta, _wp_attached_file, remove the front slash from the meta
   value
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Simple Sidebar Navigation] Strange – opening in new window](https://wordpress.org/support/topic/strange-opening-in-new-window/)
 *  Thread Starter [mrspabs](https://wordpress.org/support/users/mrspabs/)
 * (@mrspabs)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/strange-opening-in-new-window/#post-4773621)
 * PS I deactivated quick page post redirect plugin, and it fixed.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Simple Sidebar Navigation] Strange – opening in new window](https://wordpress.org/support/topic/strange-opening-in-new-window/)
 *  Thread Starter [mrspabs](https://wordpress.org/support/users/mrspabs/)
 * (@mrspabs)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/strange-opening-in-new-window/#post-4773619)
 * I removed the plugin and replaced it with this codea and it still happens, so
   its not the plugin.
 *     ```
       <ul>
       <?php
       global $post;
       $current_page_parent = ( $post->post_parent ? $post->post_parent : $post->ID );
   
       wp_list_pages( array(
            'title_li' => '',
            'child_of' => $current_page_parent,
            'depth' => '1' )
       );
       ?>
       </ul>
       ```
   
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Related Posts for WordPress] Display custom field with related posts](https://wordpress.org/support/topic/display-custom-field-with-related-posts/)
 *  [mrspabs](https://wordpress.org/support/users/mrspabs/)
 * (@mrspabs)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/display-custom-field-with-related-posts/#post-4764174)
 * +1
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Theme My Login] Change title on Lost Password page](https://wordpress.org/support/topic/change-title-on-lost-password-page/)
 *  Thread Starter [mrspabs](https://wordpress.org/support/users/mrspabs/)
 * (@mrspabs)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/change-title-on-lost-password-page/#post-4223323)
 * Oh i found it. I didn’t realize that your plugin made pages within the “pages”
   area of the dashboard. Thanks!

Viewing 15 replies - 1 through 15 (of 44 total)

1 [2](https://wordpress.org/support/users/mrspabs/replies/page/2/?output_format=md)
[3](https://wordpress.org/support/users/mrspabs/replies/page/3/?output_format=md)
[→](https://wordpress.org/support/users/mrspabs/replies/page/2/?output_format=md)