Hello,
I’d like to know if there is a possibility to create additional Custom Ads, and later add them via Visual Composer to certain pages?
Another thing is that my idea is to separate ads depending on category, so I can sell the adspace exclusively for certain category (page) of my website. Is that possible with your theme?
Hi,
If you need more custom ads you have to edit td_config.php and add it like this: http://screencast.com/t/LjL18ZfbL Then just make add it in td_panel_ads.php file – http://screencast.com/t/UB3dwNgI68
Now you can add your code in Theme Panel > Ads – http://screencast.com/t/z3ROmJFEL and display it in your page – http://screencast.com/t/aNBwX5azB
The theme doesn’t have to place ads in the category page, you will need to add it manually in the code, please check thise topic as reference: https://forum.tagdiv.com/topic/how-can-add-horizontal-sidebar/ and you can display it on specific category – https://codex.wordpress.org/Function_Reference/is_category
If you need additional customizations I suggest to get someone to do this for you as we cannot offer custom work at this time, sorry!
Thanks!
I followed these steps below to create more custom add boxes:
Edit td_config.php and add it like this: http://screencast.com/t/LjL18ZfbL Then just make add it in td_panel_ads.php file – http://screencast.com/t/UB3dwNgI68
Now you can add your code in Theme Panel > Ads – http://screencast.com/t/z3ROmJFEL and display it in your page – http://screencast.com/t/aNBwX5azB
The result was it broke my website, creating this error: Parse error: syntax error, unexpected T_STRING, expecting ‘)’ in /home/mauimagazine/www/wordpress/wp-content/themes/Newspaper/includes/td_config.php on line 2006:
I overwrote the file to fix the website, but I was hoping you can help me successfully add more custom ad boxes without breaking the website.
Thank you!
UPDATE: Actually it turns out I broke it a bit worse than I realized — my Ads section on the theme template is broken, saying: Parse error: syntax error, unexpected T_STRING in /home/mauimagazine/www/wordpress/wp-content/themes/Newspaper/includes/panel/views/td_panel_ads.php on line 1113
That is the most urgent fix I need now 🙁
-
This reply was modified 10 years by
Maui No Ka Oi Magazine.
UPDATE: I fixed this.
— IGNORE BELOW —
I tried deleting the td_config.php file on my server and uploading its original file from my theme folder on my local hard drive but it’s not fixing the error. I can’t tell why the file is not working correctly. 🙁
I checked line 1113 and there is no obvious error on that line, it looks as it should.
I cannot edit the ad boxes at all now, the Ads section is totally broken within the Theme Template.
-
This reply was modified 10 years by
Maui No Ka Oi Magazine. Reason: resolved issue
So the broken component is now fixed, thankfully, but I still would like working instructions on how to add more custom add boxes without breaking the site.
Thank you!!
Hello,
Please recheck your modification. I just tried this again on my end. It works as expected. maybe you missed a comma here: http://screencast.com/t/mplEY3lk4Em. Add a comma after each new ad spot you create. Do not add a comma at the end of the last one though.
Thanks.
Update: I found the error – it’s very strange, and it happened in both PHP files.
Even though I copied and pasted the code exactly from the line above, the code did not paste the correct version of the apostrophe character, and broke the PHP using an apostrophe that looks almost identical but must be a different character. Super strange. I had to look super close at the screen to see the difference. I had to correct this apostrophe error in both td_config and td_panel_ads files.
Now I can see it working properly with 3 custom ad sizes.
Thank you.
Hi,
The apostrophe are getting on our nerves too. Luckily we use a software for coding in php as you may have seen in our screenshots, and it highlights syntax errors such as the apostrophe. It usually happens when copying a piece of code.
Glad you figured it out.
Hi, I successfully added the new ad boxes. I can see that new slots to input the ad code from the ADS section of the Theme panel, however, I still have a problem. When I go to a page or post and I want to insert a new custom ad, say #8 custom ad, the visual editor only shows the options for custom ads 1-5, not the new ones I’ve added.
So I cannot figure out how to actually insert the extra custom ads into a page.
I appreciate your help!
Hi,
I suspect you forgot to add one of the lines provided above. Please send an email at contact@tagdiv.com , include a link to this conversation and provide wp-admin and ftp access so we can take a look at the code.
Thank you!
Thanks, I’ll email so you can look at the code.
Hello Page52,
Please ensure that your ad code is correct. So, as you can see in our documentation, the theme supports only the Google Adsense and also, if you want to use other custom ad code you will have to check this link here -> https://forum.tagdiv.com/using-other-ads-non-adsense-ads/ Also, please ensure that you are using the latest version of theme (Newspaper 7.1.1), WordPress (4.5.2) and also, the latest version of required plugins (Visual Composer 4.11.2 and Social Counter 4.1). Try to clear all your caches and test it again.
Hope this helps and let us know how it goes!
Thaks for your understanding!
Is it possible to add additional custom adverts without affecting the main theme and just using the child theme? I’m concerned all these changes will break with a theme update?
Can you advise?
Thanks
Hello Music Instrument News,
Unfortunately, these type of modifications could not be made in Child Theme because the files which are needed to change the code will not be overwritten in the child theme. For more information about our child theme support, please check the documentation here -> https://forum.tagdiv.com/the-child-theme-support-tutorial/
Thanks for your understanding!
Hi, I’v created some custom_ad and it work fine. But the banner position is only left. I’ve tried to modify the position with <div align=”center”></div> OR <div “style text-align:center”></div> but nothing change. Banners are always on left. Can you help me?
Thank you!
Hello Catalin,
Thanks. The website is http://www.menteinformatica.it/
For now I’ve put the custom_ad only in an old article to show you the problem.
Here’s the link: http://www.menteinformatica.it/spotify-you-will-get-an-sms-shortly-with-a-code-to-use-for-logging-in/
You can see the firs banner in on the left.
Thank you for fast response!
Hello darko888,
Please send us an email at contact@tagdiv.com with your log-in information (wp-admin) so we can further inspect it closer. Also, provide the link of this topic so we can easily identify you.
Thanks.
Hello darko888,
Please notice that the theme code has been changed a lot with newer updates and that’s why you cannot locate the old code, sorry! Now, you should edit only the td_config.php and have to register your new custom ad code in two places, like this -> http://screencast.com/t/drqt26uCI
Hope this helps and let us know how it goes!
Thanks for the message!
