garethf
Forum Replies Created
-
Forum: Plugins
In reply to: [WPAdverts - Classifieds Plugin] Para breaks in description textOk, for now I solved this by replacing:
<div class="adverts-content"> <?php echo $post_content ?> </div>
with:
<div class="adverts-grid-row"> <div class="adverts-grid-col adverts-col-30"> <span class="adverts-round-icon adverts-icon-search"></span> <span class="adverts-row-title">Looking For</span> </div> <div class="adverts-grid-col adverts-col-65"> <?php echo $post_content ?> </div> </div>
in the single.php file but obviously this is not best practice. Would be good to know why this doesn’t work using the code above on anyone’s ads but my own.
Forum: Plugins
In reply to: [WPAdverts - Classifieds Plugin] Para breaks in description textThanks – that worked for the para breaks issue.
However, on everyone’s ad except my own, the details are not included in the “Looking For” field – see example here where it is not displayed:
https://equity4sweat.com/advert/business-development/
Whereas here (my ad) it is displayed:
https://equity4sweat.com/advert/startup-advisor/
Whereas I know from the admin panel that details were included.
Forum: Plugins
In reply to: [WPAdverts - Classifieds Plugin] Para breaks in description textIn case you need it, here is where I add the custom field ‘experience’:
add_filter( "adverts_form_load", "my_adverts_form_load" ); /** * Adds custom fields */ function my_adverts_form_load( $form ) { if( $form["name"] != "advert" ) { return $form; } $form["field"][] = array( "name" => "experience", "type" => "adverts_field_textarea", "order" => 20, "label" => "Previous Experience", "mode" => "tinymce-mini", "is_required" => true, "validator" => array( array( "name" => "is_required" ), ) ); return $form; }
and here is where I change the name of the details field:
add_filter( "adverts_form_load", "customize_adverts_add" ); /** * Customises default fields */ function customize_adverts_add( $form ) { if( $form['name'] != "advert" ) { return $form; } foreach( $form["field"] as $key => $field ) { if( $field["name"] == "post_content" ) { $field["label"] = __( "Looking for", "adverts" ); $form["field"][$key] = $field; } } return $form; }
Forum: Plugins
In reply to: [WPAdverts - Classifieds Plugin] Para breaks in description textHmmmm, ok, actually I have two problems:
1. There are no <p> tags in the two fields details and experience when displayed here: https://equity4sweat.com/advert/startup-advisor/
2. On everyone’s ad except my own, the details are not included in the “Looking For” field – see example ehre where it is not displayed:
https://equity4sweat.com/advert/business-development/The code I used for this in my custom plugin is as follows:
add_action( "adverts_tpl_single_details", "my_adverts_tpl_single_details" ); /** * Displays custom fields on advert details page */ function my_adverts_tpl_single_details( $post_id ) { $cf = get_post_meta( $post_id, "experience", true); $cc = get_post_meta( $post_id, "post_content", false); ?> <?php if(! empty($cf) ): ?> <div class="adverts-grid-row"> <div class="adverts-grid-col adverts-col-30"> <span class="adverts-round-icon adverts-icon-briefcase"></span> <span class="adverts-row-title">Experience</span> </div> <div class="adverts-grid-col adverts-col-65"> <?php esc_html_e( $cf ) ?> </div> </div> <?php endif; ?> <?php if(! empty($cc) ): ?> <div class="adverts-grid-row"> <div class="adverts-grid-col adverts-col-30"> <span class="adverts-round-icon adverts-icon-search"></span> <span class="adverts-row-title">Looking For</span> </div> <div class="adverts-grid-col adverts-col-65"> <?php esc_html_e( join(", ", $cc) ) ?> </div> </div> <?php endif; ?> <?php }
Forum: Plugins
In reply to: [WPAdverts - Classifieds Plugin] Show Contact InformationHmm, for some reason, it is not logged in the plugin but it sent this time…
Will monitor.
Forum: Plugins
In reply to: [WPAdverts - Classifieds Plugin] Para breaks in description textParagraph breaks – ie. when the information is entered in the form, I hit return to start a new paragraph.
When it is displayed on the advert details page, it shows as one paragraph without any breaks.
Forum: Plugins
In reply to: [WPAdverts - Classifieds Plugin] Validate EmailOk, thanks!
Forum: Plugins
In reply to: [WPAdverts - Classifieds Plugin] Contact Details and Upload Image brokenThanks – mresolved as well!
Forum: Plugins
In reply to: [WPAdverts - Classifieds Plugin] Search By CategoryThanks! Updated the functions.php for the theme and it works perfectly now – seems this was a known error.
This also solved the problem with upload images!
Forum: Plugins
In reply to: [WPAdverts - Classifieds Plugin] Show Contact InformationThat’s perfect for displaying the contact form, thanks.
However, I have tested the form and it doesn’t seem to send the emails – any idea why?
Forum: Plugins
In reply to: [WPAdverts - Classifieds Plugin] Remove/Edit fields in WPAdvertsSolved this one
Forum: Plugins
In reply to: [WPAdverts - Classifieds Plugin] Show Contact InformationHi,
I don’t see whereabouts in single.php this would be added – there does not seem to be a reference to contact information in there?
Thanks!