Change Event URL to a Button

Home Forums Calendar Products Events Calendar PRO Change Event URL to a Button

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1551273
    karlsteen
    Participant

    I am trying to make the event website url appear as a button instead of a url link. I am running Events Calendar + Events Calendar PRO. I have followed the instructions provided in the events calendar knowledgebase (see following link)

    https://theeventscalendar.com/knowledgebase/url-as-word-button/

    I pasted the following snippet into my Theme functions.php (See attached) to change the URL to a Button

    add_filter(‘tribe_get_event_website_link_label’, ‘tribe_get_event_website_link_label_default’);

    function tribe_get_event_website_link_label_default ($label) {
    if( $label == tribe_get_event_website_url() ) {
    $label = “Visit Website »”;
    $class = “my-button-class”;
    }

    return ‘‘ . $label . ‘ ‘;
    }

    and added the following to my style sheet (see attached):

    .my-button-class {
    background-color: red;
    padding: 10px;
    color: #fff;
    float: left;
    }

    According to the instructions, a red button should appear instead of the URL link… However, I am just seeing a linked word. No Button (see attached)…

    Can anyone help me get this button to appear properly?

    Thanks,

    Sean
    Medias.no

    #1552062
    Cliff
    Member

    Hi. Please provide a link to one of your Single Event pages where this is implemented but not appearing as desired.

    #1552168
    karlsteen
    Participant

    Hi Cliff,

    After some messing around it appeared as desired 🙂 Not quite sure why it didn’t work properly from the get go.

    Thank you for answering though! Have a great day.

    #1552800
    Cliff
    Member

    Glad to hear and thanks for letting us know.

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Change Event URL to a Button’ is closed to new replies.