[[=title]]

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #1045336
    oniregoc
    Participant

    Hello,

    my title are like this :
    “Stage photo niveau les bases du 9 janvier 2016”

    but for obvious reason I want it shorter in the calendar and in the tooltip.

    My solution in single-event.php that shorten title into calendar :

    I did replace :

    ” rel=”bookmark”><?php echo substr(the_title($before = ”, $after = ”, FALSE), 19) ;?>

    by:

    ” rel=”bookmark”><?php echo substr(the_title($before = ”, $after = ”, FALSE), 0, calculate_how_many_letter( (the_title($before = ”, $after = ”, FALSE) ))) ;?>

    where the function added to my child theme is:

    /**
    * 12.0 – Function to calculate how many letter to delete from title
    * to get only course name without date
    *
    */

    function calculate_how_many_letter ($which_title){

    if (stripos($which_title, ‘janvier’))
    {
    return -18;
    }
    elseif (stripos($which_title, ‘février’))
    {
    return -18;
    }
    elseif (stripos($which_title, ‘mars’))
    {
    return -15;
    }
    elseif (stripos($which_title, ‘avril’))
    {
    return -16;
    }
    elseif (stripos($which_title, ‘mai’))
    {
    return -14;
    }
    elseif (stripos($which_title, ‘juin’))
    {
    return -15;
    }
    elseif (stripos($which_title, ‘juillet’))
    {
    return -18;
    }
    elseif (stripos($which_title, ‘août’))
    {
    return -15;
    }
    elseif (stripos($which_title, ‘septembre’))
    {
    return -20;
    }
    elseif (stripos($which_title, ‘octobre’))
    {
    return -18;
    }
    elseif (stripos($which_title, ‘novembre’))
    {
    return -19;
    }
    elseif (stripos($which_title, ‘décembre’))
    {
    return -19;
    }
    else
    {
    return 0;
    }

    }

    My question :
    I need to do so on tooltip but I don’t know how to do so because you can’t manipulate “handelbars” with php.

    So if you can provide any idea to help to find a solution…

    Thanks for any help !

    #1045345
    George
    Participant

    I’m sorry @oniregoc, but we cannot help troubleshoot custom code problems here 🙁 I’m sorry! But I will have to close up this thread for now. Please read the “Product Support” section of our site terms here for more information → http://theeventscalendar.com/terms

    Cheers,
    George

Viewing 2 posts - 1 through 2 (of 2 total)
  • The topic ‘[[=title]]’ is closed to new replies.