1 (edited by 2015-05-25 07:34:25)

Topic: Tag section

Hi Support Team,

In the tag section, how to implement a specific title :

Instead of <title>News by tag - Title site</title>

Something like that <title>Tag Name - Title site</title>

.......

Same thing with categorie :

Instead of <title>News by category - Title site</title>

Something like that <title>Catagory Name - Title site</title>

Thanks you for your help.

2 (edited by 2015-05-25 07:33:57)

Re: Tag section

Try using the following code.

<?php

if (isset($_GET['tag'])) {
    $tag_title = "<title>".cn_htmlspecialchars($_GET['tag'])." - Title site</title>";
} else {
    $tag_title = "<title>Title site</title>";
}

if (isset($_REQUEST['category'])) {

    require_once("core/init.php");

    $_cat_ar = array();
    $_category = $_REQUEST['category'];
    $cn = cn_get_categories();
    $_category = explode(',', $_category);

    foreach ($_category as $_cat_id) {
        if ($_cat_id) {
            $_cat_ar[] = cn_htmlspecialchars($cn[$_cat_id]['name']);
        }
    }

    $tag_title = "<title>".cn_htmlspecialchars(join(', ', $_cat_ar))." - Title site</title>";
}

?>
<?php echo $tag_title;?>

<?php echo $tag_title;?> should replace <title>...</title>, the string with require_once("core/init.php"); should indicate the right path to the file.

Best regards,
CN Support team

Re: Tag section

Hi Support Team,

Work fine for category... great

But

Don't work for tagline (I've tested many time etc)

Thanks you