S
S
spay1112022-02-03 13:42:50
Joomla
spay111, 2022-02-03 13:42:50

Remove AdSense code from some pages in Joomla 3.10.5 (PHP 7.4)?

Good afternoon!
Please tell me how to remove the AdSense code from some pages on Joomla 3.10.5 (PHP 7.4) using the K2 component
Tried (prescribed in the template) <

?php
if ($_SERVER["REQUEST_URI"]!='/')
{
AdSense code >
}

Added several pages separated by commas, the code does not work (ads remain on the pages)

Maybe someone knows the working code
Or knows how to solve this problem in a different way
Through the module is also not an option, since the pages are in the same category with others pages
Use a different output template for the material will not work because the pages on K2

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
exmmth, 2022-02-03
@exmmth

<?php 
echo JFactory::getURI()->toString(); /*полная ссылка https://site.ru/my_link?my_query#my_fragment  */
echo JFactory::getURI()->toString(array('path', 'query', 'fragment')); /* ссылка частичная /my_link?my_query#my_fragment  */
?>

These examples, I think, will suffice, write the comparison conditions yourself.
The getURI() documentation is easy to google if you need something specific

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question