• Good afternoon. I have a problem.
    I created single-advert.php file. I copied the code from the template of your add-on single.php into it, but as you can see in the screenshot, the gallery displays all the pictures from the site, information about the seller is not displayed on click, there is no title and no description. The file itself, which lies in the wpadverts > templates directory, was not connected, but only the file from the root folder (default) was connected. I can’t figure out what I’m doing wrong. Help
    https://disk.yandex.com/i/c8YGPMkKgqn7Lw
    https://disk.yandex.com/i/EVb_cBLj2liXBQ

Viewing 9 replies - 1 through 9 (of 9 total)
  • Thread Starter evmia

    (@evmia)

    If you add an ad through the frontend, then everything works fine, but after clicking the “Publish” button, it stops working. Please help, I really need it!
    https://disk.yandex.com/i/-ixa6e5P8clWGw

    Plugin Author Greg Winiarski

    (@gwin)

    Hi,
    i would need some more details on the problem you are having:

    1. does it work with the default template file (that is when you delete or rename the single.php you created)?

    1a. if it does not work with the default template files, does it work if you switch to a different theme?

    2. what will show on the screen on the Ad details pages if add there the following code

    
    <?php var_dump( $post_id ) ?>
    
    Thread Starter evmia

    (@evmia)

    I have already solved the problem. The problem was in the function.php file

    Thread Starter evmia

    (@evmia)

    But I got a new problem that I can’t solve in any way. The wp discuz plugin is installed, and it does not want to display the way of commenting on the ad page in any way. Can you tell me how to do this and is it possible to include comments in your plugin?

    Plugin Author Greg Winiarski

    (@gwin)

    Hi,
    by default the comments are disabled on the Ad details pages, you can go to wp-admin / Classifieds / Options / Core / Types panel and enable comments from there.

    This will only allow using the comments on the Ad details pages but by default the comments will be disabled, to enable them when an Ad is published or updated add the code below in your theme functions.php file

    
    add_action("adverts_insert_post", "enable_adverts_comments_check");
    add_action("adverts_update_post", "enable_adverts_comments_check");
    function enable_adverts_comments_check( $data ) {
        $data["comment_status"] = "open";
        return $data;
    }
    

    Note that the ads you already have in the database have the comments disabled, so you need to edit each of them from wp-admin panel and enable the comments only then the form will show on the Ad details pages – again this is for existing Ads only the ones that you add after adding the above code should have comments enabled by default.

    Thread Starter evmia

    (@evmia)

    wp-admin / Classifieds / Options / Core / Types I don’t have such a path in the site directory. The code that in functions.php I inserted it, but unfortunately I didn’t understand how to include comments in the wp-admin / Classifieds / Options / Core/Types path. Help please
    https://disk.yandex.com/i/CCL8RvGeYSwPnQ

    Plugin Author Greg Winiarski

    (@gwin)

    The wp-admin / Classifieds / Options / Core / Types is not a path in the system folder these are basically links in the wp-admin panel you need to click in order to get to the Types panel where you can make these changes.

    In other words clicking them in this order should get you to this page https://demo.wpadverts.com/lite/wp-admin/edit.php?post_type=advert&page=adverts-extensions&module=core&adaction=types&edit-post=advert on your website.

    Thread Starter evmia

    (@evmia)

    Thank you Greg! Thank you so much!!! =)

    Plugin Author Greg Winiarski

    (@gwin)

    Hi,
    ok great, i am glad you have the issue resolved :), I am marking this thread as resolved then.

    BTW. If you are finding the plugin useful i would be thankful if you could write a short one or two sentence review here https://www.ads-software.com/support/view/plugin-reviews/wpadverts

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Problem with single.php’ is closed to new replies.