Add Listings page

This topic contains 7 replies, has 2 voices, and was last updated by  Guust 7 years, 11 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #203500

    BJ Bowen
    Full Member
    Post count: 73

    I’d like to welcome the user, give them a little paragraph of info, instructions and “what to expect”… So, I went to the Add Listings page in the WP Admin > Pages > Add Listing > Edit Page… and I added the content to the editor.

    This content doesn’t show up anywhere on the Add Listing page on the front-end.

    I’m using Avada theme (everything is at it’s latest version).

    Am I doing something wrong? missing some bonehead obvious checkbox? Or is this how the theme is built? If I have to change the php file, that’s fine, but I just want to know what’s going on before I do that.

    (This is a great theme… great support… great everything. I made my clients switch from another directory theme to use you guys because you’ve done such a great job… just wanted you to know that.)

    #203514

    BJ Bowen
    Full Member
    Post count: 73
    This reply has been marked as private.
    #203574

    Guust
    Moderator
    Post count: 29970

    From https://wpgeodirectory.com/docs/layout/

    In the Pages section of your WP admin dashboard, you can change the title and the slug of the page. Nothing else can be changed there.

    The easiest way I can think off is to use the translation file and change

    * Indicates mandatory fields

    to something like

    * Indicates mandatory fields<br/>My note to customers

    https://wpgeodirectory.com/docs/translate-core/ explains how to do that.

    #203671

    BJ Bowen
    Full Member
    Post count: 73

    Okay.. thanks for that… still on the Add Listings page. I want to change some of the wording. For example “Enter Listing Details” I’d like to change to “Enter Business Details”.

    I can’t see there’s a place for that in the admin, so, I’ve successfully changed the language.php file. When I move that file to the Child Theme, the changes don’t stick.

    I put it Child Theme > geodirectory > language.php

    This structure worked when I put my customized add-listing.php.

    How do you suggest that I do this? Will I need to write a function?

    #203837

    BJ Bowen
    Full Member
    Post count: 73

    For all who may want to change the Add Listing page:

    INTO PARAGRAPH TO ADD-LISTING PAGE
    You can copy the add-listing.php into the Child Theme and make changes to the file if you want to add an intro/welcome/instruction paragraph by following these steps:
    1. Create a new folder in the Child Theme and name it geodirectory
    2. Copy the add-listing.php file to that folder
    3. Add your html just above the “do_action(‘geodir_add_listing_page_mandatory’);”

    CHANGE THE ADD LISTING FORM
    You can change the label names of the form fields (that aren’t governed by the wp-admin GeoDirectory > Place Settings) by removing the function that creates the form.

    Here’s how to REMOVE the function:

    Add this code to your child theme functions.php file:

    add_action(‘init’ , ‘remove_functions’ , 15 );
    function remove_functions() {
    remove_action(‘geodir_add_listing_form’, ‘geodir_action_add_listing_form’);
    }

    1. Then copy the geodir_action_add_listing_form function (find it in the geodirectory_template_actions.php on line 2098).

    2. Paste the code into your child theme functions.php and change the name to something unique like “change_geodir_action_add_listing_form” as in the example below:

    add_action(‘geodir_add_listing_form’, ‘change_geodir_action_add_listing_form’, 20);

    function change_geodir_action_add_listing_form() {
    //function contents//
    }

    3.Change the function contents to your customization

    CHANGE THE LABELS
    Note: Look in the language.php file to find the defined values for the form labels. For instance: To change the label that reads “Listing Title” to something that says “Business Name”,
    1. look at the language.php file and you’ll see that it is defined as ‘PLACE_TITLE_TEXT’.
    2. find PLACE_TITLE_TEXT in the function (the one you’re customizing in the child theme) and it will look like this: <label><?php echo PLACE_TITLE_TEXT;?><span>*</span> </label>
    3. REMOVE “<?php echo PLACE_TITLE_TEXT;?> ” and replace it with “Business Name”.

    The code will now look like this: <label>Business Name<span>*</span> </label>

    #203938

    Guust
    Moderator
    Post count: 29970

    Please review https://wpgeodirectory.com/docs/translate-core/ again, you are not translating correctly.

    Thanks for sharing some tips, that is explained at https://wpgeodirectory.com/docs/customizing-geodirectory-templates/ for those that want to change templates.

    The last bit about changing the labels is not recommended: that needs to be done using the language files (.PO and .MO files), or by changing the labels of the custom fields at GD > Place Settings > Custom Fields
    https://wpgeodirectory.com/docs/core-place-settings/#custom

    #204069

    BJ Bowen
    Full Member
    Post count: 73

    Thank you for your reply. I could not find instructions to edit the add-listing.php and when I wrote to you, your reply was to simply change the text using the .po and .mo files. So, that didn’t really help with the html. That’s why I put the instructions.

    As for the last bit, I’ve never used a theme that required so much effort to change some field label names. Still, this is a great theme and I appreciate your help.

    Is there a reason that I can’t do it the way I have done it?

    #204073

    Guust
    Moderator
    Post count: 29970

    You can use HTML in the PO file so the output would be HTML.

    Most field label names are simply changed at GD > Place Settings > Custom fields.
    Some need to be changed using the translation files.
    Changing language.php will mean that in the next update, all your changes will be lost.

Viewing 8 posts - 1 through 8 (of 8 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket