Hi, hmm i am not sure, it seems that there is some kind of infinite loop which creates multiple copies of the Ad.
If you have some third party plugins installed please try to deactivate them and see if this helps, if not then try switching your theme for a while and then post an Ad.
Hey Greg,
I tried all the suggestions but it still doesn’t work.
Is there anything else which can be done?
Many thanks!
Hmm i am not sure, is the theme you are using free? That is can i download it somewhere to test on my dev site?
Hey Greg,
Yes, it is a free theme by siteOrigin:
https://siteorigin.com/theme/vantage/
Hi, i tried installing the theme, but WPAdverts works fine for me with this theme.
The only idea i have left is to open file wpadverts/includes/shortcodes.php file, find line
$post_content = apply_filters("the_content", get_post( $post_id )->post_content );
replace it with
$post_content = get_post( $post_id )->post_content;
and see if this helps.
Hey Greg,
This worked, this is really awesome.
Thanks so much. You don’t know how much this means for me!
Sure, no problem, please note that you might need to redo this change after updating WPAdverts to latest version.
Hello Greg,
Unfortunately, the same infinite loop also happens when the user publishes the listing. Is there anything we can do to solve this?
Do you know why this is happening?
Is there something that I am doing wrong?
To be precise, it is not an infinite loop (my mistake), it just has the same blank page as before the error was fixed. However, in the backend, it seems like the advert is being posted.
Once the user goes back to listing page, they will be able to see the ad.
There seems to be no page/pop up to inform about the ad once he clicks publish listing. I doubt this is the way the plugin works?
My first guess was that the_content filter is being executed first by theme and then by WPAdverts which caused an infinite loop, if that is not the case then i am not really sure.
What you can do is open file wp-config.php add there line
define("WP_DEBUG", true);
and try posting an Ad again, then aside of blank page you should also see an exact error message which caused the blank screen.
Hello Greg,
I have the debugging code.
I’m not sure if it’s okay/safe to post it here or can I email it to you?
Many thanks!
Hi, posting the error message here should be safe if it does not contain any private data like login or password, you can additionally remove from file paths everything before wp-content (so if the file path is /home/greg/public_html/wp-content/plugins/wpadverts/wpadverts.php, remove the /home/greg/public_html/).
Hey Greg,
Thanks so much. This is the debug message:
Notice: bp_setup_current_user was called incorrectly. The current user is being initialised without using $wp->init(). === Trace: #6 /wp-content/themes/vantage/inc/settings/settings.php(46): current_user_can(‘install_themes’) #7 /wp-content/themes/vantage/inc/settings/settings.php(60): SiteOrigin_Settings->__construct() #8 /wp-content/themes/vantage/inc/settings/settings.php(823): SiteOrigin_Settings::single() #9 /wp-content/themes/vantage/functions.php(14): include(‘/home/axposure/…’) #10 /wp-settings.php(387): include(‘/home/axposure/…’) #11 /wp-config.php(90): require_once(‘/home/axposure/…’) #12 /wp-load.php(39): require_once(‘/home/axposure/…’) #13 /wp-blog-header.php(13): require_once(‘/home/axposure/…’) #14 /index.php(17): require(‘/home/axposure/…’) # in /wp-includes/functions.php on line 3996
Hi, hmm is there some other message further? This one is just a notice, it should not stop the PHP execution (that is whole page content should be rendered).
Also, i allowed myself to post one more Test Ad, and it seems that the HTL ends before JetPack tags, so it looks like there is a problem / conflict with JetPack, please try disabling it and see if this helps?
Hey Greg,
I’ve disabled the jetpack plugin and it goes to a page that says “add”.
Thank you for your suggestion.
You’re really brilliant.