Php files not saving and/or executing any new / additional code

Posted in: Newspaper
Post count: 22

Been having a lot of issues with editing php files (any new code i add does not execute if done directly in php files).

Example 1:

I attempted to place a google analytics code in the header file just above </head> directly in header.php file, it would not execute…..UNLESS you use one of your pre-built boxes in the theme panel such as “Google analytics code and javascript codes”

I tried doing the changes directly from our server on the php files, the changes would not even submit.

I am using one of the cloud templates, so i am not sure what is going on but i need to be able to add extra codes via php files such as header.php and single.php…..very simple things that i need to add, google adsense code, admanager code e.t.c but some have a combination of php and javascript.

Please assist

Post count: 35449

Hi,

Yes, the code for analytics can be set in this place in theme panel -> https://i.imgur.com/EKCss3G.png
There are multiple headers in our them, for example if you are using tagDiv Standard pack the file that you want to edit is this one -> wp-content/plugins/td-standard-pack/Newspaper/header.php if you do not use standard pack, only tagDiv Cloud Library with tagDiv Composer, then the file is this one -> wp-content/plugins/td-composer/legacy/Newspaper/header.php

Thank you!

Post count: 22

Thanks a bunch Calin for a well ellaborated answer, i was able to put the code and got it to work, it is in the td-standard-pack!!

That said, i have one extra question for now, i am trying to open up some divs in the posts but i can see the div names in chrome console, but unable to find them in single.php or loop-single.php.

Can you kindly guide me (refer to the link containing screenshot of what i am trying to do) with the php file (a whole path again) and div name i should look for where i can add my banner?

Screenshot – https://drive.google.com/file/d/1uWdTLSdNWfnTnDgETp7FGsM0OFt6LVFH/view?usp=sharing

Thanks in advance for your help again!

Post count: 35449

Hi,

If all you want to do is to set some ads in post template, all these cloud be achieve using a cloud template and tagDiv Composer.
For standard post templates you need to edit the template you are using, the are set on this folder path wp-content/plugins/td-standard-pack/Newspaper/parts/single for example if you want to add these banners for single post template 1 you need to set the code here -> https://i.imgur.com/pbNIEIl.png -> and here -> https://i.imgur.com/6mHGXUA.png
You can use this code to set the ads from custom ad -> https://i.imgur.com/6PXGFJo.png
<?php echo do_shortcode('[td_block_ad_box spot_id="custom_ad_1"]'); ?>
If you use the default post style you need to edit this file path -> wp-content/plugins/td-standard-pack/Newspaper/loop-single.php

Hope this will help you!
Thank you!

Post count: 22

Thanks a bunch Calin….you are instructions are always right to the point! i have managed to get the job done, it was in template #2.

I am good for now, will reach out in the near future if i need help with other things as we are still setting up the site!

Overall, great customer service and instructions!

Post count: 35449

Thank you for your kind words!
If you have some questions related to our theme, just let us know!
Have a nice day!

Viewing 6 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic.