Adding css or shortcode to change list view of events calendar pro

Home Forums Calendar Products Events Calendar PRO Adding css or shortcode to change list view of events calendar pro

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #935398
    meredy
    Participant

    I added this code in rhe before html box which worked great but unfortunately added the image to every view including single event views and I only want it to show on the list view or month view.
    [blank h=”-85″]

    [/blank]
    [layerslider id=”5″]

    [/layerslider]

    [blank h=”-45″]
    I added this css to change the Month size on list view but can’t find the class to change the body text color on that same link view…how do I search for classes in order to make changes through css?
    .tribe-events-list-separator-month span {
    background: none;
    color: #D14D42;
    font: normal 20px/20px “Raleway”;
    }
    [/blank]

    #935416
    Barry
    Member

    The add HTML before/after event content fields do indeed add whatever you provide to every single event view 🙂

    However, what you want is definitely possible. There are a at least a couple of ways you might go about it – check out these related forum posts to explore this futher:

    Let me know how you get on/if you have further questions about this 🙂

    I added this css to change the Month size on list view but can’t find the class to change the body text color on that same link view…how do I search for classes in order to make changes through css?

    The best way to search for CSS classes is to use your browser’s built-in developer tools (which most modern browsers provide). Often they will let you test out CSS changes, too. To learn more about this, please refer to your browser documentation.

    #935655
    meredy
    Participant

    Great advice but have an additional question–since I added short-code to the “html before” do I need to put that in the function area instead of the image src? See below:
    /**
    * Calendar page this
    */

    add_filter( ‘tribe_events_before_html’, ‘add_list_view_header_img’ );
     
    function add_list_view_header_img( $html ) {
        if ( ! tribe_is_list() ) return $html;
        $html .= ‘‘;
        return $html;
    Or this:
    /**
    * Calendar page
    */

    add_filter( ‘tribe_events_before_html’, ‘add_list_view_header_img’ );
     
    function add_list_view_header_img( $html ) {
        if ( ! tribe_is_list() ) return $html;
        $html .= ‘[blank h=”-85″]

    [/blank]
    [layerslider id=”5″]

    [/layerslider]

    [blank h=”-45″]

    [/blank]’;

        return $html;

    #935656
    meredy
    Participant

    I kind of messed up that post but I guess I’m asking how functions code might change if I am inserting shortcode into the html before area?

    #935732
    Barry
    Member

    No worries – though it’s often best to share code using a service like Gist or Pastebin and simply link to it from posts here in the forum 🙂

    To answer your question, it’s totally up to you if you want to use shortcodes or not – but you may find you need to pass them through do_shortcode() or they might simply be printed directly.

    Does that help?

    #935762
    meredy
    Participant

    I made a change to the functions.php file Got this error and immediately removed the code from the functions.php file and reuploaded it but nothing changed. How can I fix this???????
    Internal Server Error

    The server encountered an internal error or misconfiguration and was unable to complete your request.

    Please contact the server administrator, and inform them of the time the error occurred, and anything you might have done that may have caused the error.

    More information about this error may be available in the server error log.
    Here is original functions.php

    <?php
    
    /**
    * Theme functions. Initializes the Vamtam Framework.
    *
    * @package wpv
    */
    
    $GLOBALS['wpv_theme_tested_up_to'] = '4.0.x';
    
    require_once('vamtam/classes/framework.php');
    
    new WpvFramework(array(
    'name' => 'church-event',
    'slug' => 'church-event'
    ));
    
    // TODO remove next line when the editor is fully functional, to be packaged as a standalone module with no dependencies to the theme
    define ('VAMTAM_EDITOR_IN_THEME', true); include_once THEME_DIR.'vamtam-editor/editor.php';

    to which I added your code with change to list and img src:

    add_filter( 'tribe_events_before_html', 'add_list_view_header_img' );
    
    function add_list_view_header_img( $html ) {
    if ( ! tribe_is_list() ) return $html;
    $html .= '<img src="http://bachfestivalflorida.org/test/wp-content/uploads/2015/01/johnwchoir-H900x428.jpg" alt="" />';
    return $html;
    }
    #935894
    Barry
    Member

    Hi Meredy,

    As in my last reply I would again recommend sharing code using a service like Gist or Pastebin and simply link to it rather than posting it directly as you’ve been doing: I’ve tried to fix up what you posted – but I can’t be certain if it is complete and accurate at this point 🙂

    to which I added your code with change to list and img src

    So I think the problem is that there is no such function as tribe_is_list() – and trying to call a non-existent function in PHP can indeed cause a few problems – please try using tribe_is_list_view() instead.

    Does that help?

    #940889
    Barry
    Member

    Hi! It’s been a while so I’m going to go ahead and close this thread. If we can help with anything else, though, please don’t hesitate to create new threads as needed. Thanks!

Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘Adding css or shortcode to change list view of events calendar pro’ is closed to new replies.