Preview post submit error

This topic contains 9 replies, has 2 voices, and was last updated by  Alex Howes 6 years, 1 month ago.

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

Open Support Ticket
  • Author
    Posts
  • #429238

    Alex Howes
    Expired Member
    Post count: 175

    Hello,

    When I add a listing (on the front end) an error shows on the preview page. The error is:

    Notice: Undefined property: stdClass::$post_category in /big/dom/xbarn_door/www/wp-content/plugins/geodirectory/geodirectory_template_actions.php on line 1123

    I’ve deactivated all my snippets in case one of these was causing the problem, but the error is still there.

    Thanks for any help 🙂

    Alex

    #429241

    Guust
    Moderator
    Post count: 29970

    Can you post your URL and WP admin details in a private reply, so we can investigate for you?
    Thanks

    #429282

    Alex Howes
    Expired Member
    Post count: 175
    This reply has been marked as private.
    #429285

    Guust
    Moderator
    Post count: 29970

    I don’t get any errors?

    #429289

    Alex Howes
    Expired Member
    Post count: 175

    The error appears after you press “Review Farm Listing” on the next page. It appears in between the CV title and the tabs. E.g. I created a CV called “Test 5” and the preview page looks like this (see attached):

    #429293

    Guust
    Moderator
    Post count: 29970

    You have no CV categories, and seem to have deleted the default categories custom field.

    You have hidden the description I think, instead of setting it to zero characters in the price package.

    One of you multiselect fields use a “/” which you should not do: https://wpgeodirectory.com/docs/core-place-settings/#multiselect

    Please check those first.

    #429295

    Alex Howes
    Expired Member
    Post count: 175

    I’ve removed the “/” from my multiselect field.

    Do I have to have CV categories? I’ve disabled physical location for that CPT.

    What do you mean about setting the description to zero characters in the price package?

    #429297

    Alex Howes
    Expired Member
    Post count: 175

    I’ve now added a category to CV, and since there is only one would like to hide the category select option in the add listing form and assign that category automatically. I have written the following code based on this https://wpgeodirectory.com/support/topic/autofill-category/

    jQuery(document).ready(function(){

    if(location.pathname == “/add-listing/”)
    {
    $price_id = jQuery(‘[name=”package_id”]:checked’).val();

    if($price_id == 5)
    {
    jQuery(‘#gd_placecategory.chosen_select’).val(’82’).change();
    setTimeout(function()
    {
    jQuery(‘input[name = post_default_category][value = 82]’).attr(“checked”, “checked”);
    }, 2000);

    }

    }

    });

    It isn’t working 🙁 Does it need to be modified to specify which CPT I’m interested in? (Though I thought this was done by the “price_id” bit). I’ve tried changing #gd_placecategory to #gd_cvcategory but this doesn’t solve the problem.

    #429320

    Guust
    Moderator
    Post count: 29970

    Yes, it needs to specify the category.

    But I suggest to delete one of your multiselects and use them as categories instead. Eg “Looking Farm Work Types”, “Looking for Job Types”, “Regions”. “Regions” seems the perfect candidate.

    Wordpress does not work without posts (listings) being in at lease one category.

    To set the description to not required, see image:

    #429383

    Alex Howes
    Expired Member
    Post count: 175

    Thanks for pointing that out Guust, that’s a nice neat solution. I’ve set it to “Looking for Job Types” to tie in with my job CPT.

    Alex

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

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

Open Support Ticket