mrspabs
Forum Replies Created
-
Forum: Plugins
In reply to: [The Pack Elementor addon] how to removenevermind. i was able to remove it the normal way.
Forum: Fixing WordPress
In reply to: limit the number of times a subscriber can loginLooks 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
Forum: Fixing WordPress
In reply to: Meta.php and problems with memoryThanks
Forum: Plugins
In reply to: [Ultimate WP Query Search Filter] Searching by date rangeThank 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; }
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 ago by mrspabs.
Forum: Plugins
In reply to: [User Groups] other main menu for people who belong to group XDid you ever figure out how?
Forum: Fixing WordPress
In reply to: thumbnail as background image with fallbackFigured 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
In reply to: Get the title and featured image via post idThanks! 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
In reply to: [Custom Field Suite] Adding Select Field To the LoopJust 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
In reply to: [Quick Page/Post Redirect Plugin] 301s keep defaulting back to 302sHi 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
In reply to: loop with the_query instead of query_posts – with paginationi 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
In reply to: [Regenerate Thumbnails] Where does it look for the imagesOh i see what i did wrong
the table is _postmeta, _wp_attached_file, remove the front slash from the meta value
Forum: Plugins
In reply to: [Simple Sidebar Navigation] Strange – opening in new windowPS I deactivated quick page post redirect plugin, and it fixed.
Forum: Plugins
In reply to: [Simple Sidebar Navigation] Strange – opening in new windowI 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
In reply to: [Related Posts for WordPress] Display custom field with related posts+1
Forum: Plugins
In reply to: [Theme My Login] Change title on Lost Password pageOh i found it. I didn’t realize that your plugin made pages within the “pages” area of the dashboard. Thanks!