James Gehring
Forum Replies Created
-
AuthorPosts
-
That worked. thanks
Let me see if I can explain better. I have a custom field that has a radio with values 1,2,3,4,5. They select one, lets say 5. In v1 I modified the listing-listview-mycustomposttype.php file.
I added this code to show stars instead of the number.
if(in_array($post->geodir_landlord_rating, array(1,2,3,4,5) )){
echo ‘<i class=”fa fa-star gd-full-star”></i>’;
}else{
echo ‘<i class=”fa fa-star-o gd-empty-star”></i>’;
}if(in_array($post->geodir_landlord_rating, array(2,3,4,5) )){
echo ‘<i class=”fa fa-star gd-full-star”></i>’;
}else{
echo ‘<i class=”fa fa-star-o gd-empty-star”></i>’;
}if(in_array($post->geodir_landlord_rating, array(3,4,5) )){
echo ‘<i class=”fa fa-star gd-full-star”></i>’;
}else{
echo ‘<i class=”fa fa-star-o gd-empty-star”></i>’;
}if(in_array($post->geodir_landlord_rating, array(4,5) )){
echo ‘<i class=”fa fa-star gd-full-star”></i>’;
}else{
echo ‘<i class=”fa fa-star-o gd-empty-star”></i>’;
}if(in_array($post->geodir_landlord_rating, array(5) )){
echo ‘<i class=”fa fa-star gd-full-star”></i>’;
}else{
echo ‘<i class=”fa fa-star-o gd-empty-star”></i>’;
}Is there a way to accomplish this in v2?
Page with v1 code http://crematchup.com/landlord-reviews/
Page with v2 https://crematchuppreview.epickmarketing.com/landlord-reviews/Can you at least point me to the file in the plugin directory that outputs the keyword field so I can try to figure it out myself. Thanks
My client wants people to be able to put a comma in a number field. so I need to make it a text field and then before it saves to database covert it to just a number number with no commas so it doesn’t mess up the search part.
That worked perfectly. Thanks
It is in the search bar. I have included a screenshot. I want to add an input field into the search bar, but not by adding a custom field. It can be by using a filter or jquery or whatever. I don’t need help modifying the query just getting the field into the search bar. I can do it with Jquery on the custom post type page itself because the form loads for the post type on its own page. The problem is getting the field to show in the form on every page and also when you change the custom post type on the form itself. I know this is a strange request, but the client asked for a way to search that the custom fields don’t really work well with.
I didn’t use v2 because the site has a lot of customizations and I am not sure if they would work with v2 so I left it the way it is.
I am trying to add in my own input field on one of the custom post types and then use _my_geodir_listing_loop_filter to change the query. I have the filter working correctly but can’t get the input field to stay on the form. If I use a custom field and try to override the query it adds in that custom field on top of my custom query. I need to be able to add my own input into the form. I can do it on the form when it is on the custom post type page but if you change the post type selection it reverts the form to the default without my input.
I don’t see an option like that one. What field would I use to see that? I checked the advanced search and tried every option I could find.
Sure thing.
Here is a solution for anyone who wants to do this in the future. This is using bootstrap 3 modal.
The link<a data-toggle="modal" data-target="#reviewModal" class="jtf=info-box-link">Leave a Review</a>
Add to footer.php you may need adjust your login url if it is not /login
<?php if ( get_post_type( get_the_ID() ) == 'gd_place' ) { $current_user = wp_get_current_user(); echo '<div class="modal fade" id="reviewModal" tabindex="-1" role="dialog" aria-labelledby="reviewModalLabel"> <div class="modal-dialog" role="document"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> <h4 class="modal-title" id="reviewModalLabel">'; the_title(); echo '</h4> </div> <div class="modal-body">'; if(is_user_logged_in()){ echo ' <form action="/wp-comments-post.php" method="post" id="commentform" class="comment-form"> <p class="logged-in-as"><a href="/wp-admin/profile.php" aria-label="Logged in as '. $current_user->display_name .' <div class="br-wrapper br-theme-fontawesome-stars"> <select class="gd-fa-rating" style="display: none;"> <option value=""></option> <option value="1">Terrible</option> <option value="2">Poor</option> <option value="3">Average</option> <option value="4">Very Good</option> <option value="5">Excellent</option> </select> </div> <input type="hidden" id="geodir_overallrating" name="geodir_overallrating" value="0"> <p class="comment-form-comment"><label for="comment">Review text <span class="required">*</span></label><textarea id="comment" name="comment" cols="45" rows="8" aria-required="true" required=""></textarea></p> <p class="form-submit"><input name="submit" type="submit" id="submit" class="submit" value="Post Review"> <input type="hidden" name="comment_post_ID" value="'. $post->ID .'" id="comment_post_ID"> <input type="hidden" name="comment_parent" id="comment_parent" value="0"> </p> <input type="hidden" id="_wp_unfiltered_html_comment_disabled" name="_wp_unfiltered_html_comment" value="4ff31c56bd"> </form>'; }else{ echo '<p> You need to be logged in to leave a review <a href="/login/?redirect_to='.get_the_permalink($post->ID).'">Login Now</a> </p>'; } echo '</div> </div> </div> </div>'; } ?>
That is exactly what I want to do.
I created the field as he said and used the exact input. I don’t need an expert to help me as my skills are pretty high level, I just thought Y’all might know what was happening since I set it up the way it was told to me.
Thanks for your help. I will figure out why it is not saving on my own since it seems that reading isn’t yalls specialty.
Like I had said in my previous reply.
If I fill in the field your code creates it doesn’t save to the database.
That is the field your action created. It did not save
If I save to the field that is created when adding to the GeoDirectory > CPT Settings it will.
This is the code that was generated when I created the custom field in the back end.
<input field_type="text" name="geodir_custom_address" id="geodir_custom_address" class="geodir_textfield gd-form-control" type="text">
The input your code created
<input field_type="text" name="geodir_custom_address" id="geodir_custom_address" type="text" class="geodir_textfield">
The input auto-created from the custom field. As you can see they are almost identical.
But thanks for your help anyways
If I fill in the field your code creates it doesn’t save to the database. If I save to the field that is created when adding to the GeoDirectory > CPT Settings it will. Any idea whats going on?
That works. Will it create a column in the database or do I need to create one for it?
I am wanting to add a second address field right under the Address field on the add listing form. If it cant be done with via action/filter can you point me to the file that contains the form fields?
I cant add a custom field for the second address because I need it to be right below the main Address field. I don’t want to modify core plugin files, but will if there is no other way.
Thanks
Worked perfect Thanks!
-
AuthorPosts