Glitchy Next Month and twitter

Home Forums Calendar Products Events Calendar PRO Glitchy Next Month and twitter

Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #904272
    Donna
    Participant

    It would seem the world of Modern tribe might end in 2015 at least according to http://www.indiebusinessnetwork.com/events-calendar/ since the ability to move forward to 2015 at the bottom right is not showing up. I see a snippet posted in another thread, but where does it go? Help?
    Also – The jetpack share buttons all work except Twitter, so on a single event you can click all but twitter and it links fine , but a twitter post returns a result like thisL
    IBN Member Success Call: How to Create a Vision Board for Your Best New Year, with Da-Nay Mackl… via @IndieBusiness
    There’s no link for someone to click to see the event, I tried to flush out the permalinks to see if it helped, it didn’t. Thanks!

    #904680
    Brian
    Member

    Hi,

    Sorry for the issues you are having. I can help out.

    Can you let me know which snippet you are referring to and I can let you know where to put it. Most likely you will add it to your theme’s functions.php

    Twitter
    I went to your site and saw what Jetpack sharing is doing. The single event is a WordPress custom post type so by default Jetpack does not create a shortlink for it. That maybe the issue.

    If you use this tutorial:

    http://code.tutsplus.com/articles/quick-tip-add-shortlinks-to-custom-post-types–wp-31892

    To add shortlinks to events, by replacing

    portfolio

    with

    tribe_events

    That may work out. We can help out a little more here, but it maybe beyond the support we can provide is the issue is bigger then this.

    Let me know about the Next Month Snippet and I can help out with that one some more as well.

    Thanks

    #904703
    Donna
    Participant

    So like:
    /**
    * A function which adds a shortlinks button for ‘tribe_events’ post type
    */
    function wptuts_shortlinks_for_portfolio( $shortlink, $id, $context ) {

    // Context can be post/blog/meta ID or query
    $post_id = 0;

    if ( ‘query’ == $context && is_singular( ‘tribe_events’ ) ) {

    // If context is query use current queried object for ID
    $post_id = get_queried_object_id();

    }
    elseif ( ‘post’ == $context ) {

    // If context is post use the passed $id
    $post_id = $id;

    }

    // Only do something if of portfolio post type
    if ( ‘tribe_events’ == get_post_type( $post_id ) ) {
    $shortlink = home_url( ‘?p=’ . $post_id );
    }

    return $shortlink;
    }
    add_filter( ‘pre_get_shortlink’, ‘wptuts_shortlinks_for_portfolio’, 10, 3 );

    what about the word portfolio in the last line referencing wptuts that one to, and put it where in my themes function php? Just want to be sure I am timid with PHP I feel better if I know exactly what to put and where. Thanks!

    #905071
    Brian
    Member

    Yep that goes in your theme’s functions.php.

    That looks like it should work. I placed it in my site and did not get any errors.

    In the last line in the filter with the word portfolio:

    wptuts_shortlinks_for_portfolio

    Has to be the same name as the function, which is this at the top:

    function wptuts_shortlinks_for_portfolio

    So if you can rename them, but they should both match.

    Show Next Month Links
    If you would like to always show next month links. Here is that snippet:

    https://gist.github.com/elimn/67679b0b9b74793a53f0

    Please also place that in your theme’s function.php file.

    I would not do both at the same time. Test one first and make sure it it working before starting on the other one.

    Let me know how this all works out.

    Thanks

    #905167
    Donna
    Participant

    Oh no that code took the site down I got it out but something definitely didn’t like it

    #905525
    Brian
    Member

    Oh that can happen. I wonder if it is the quote marks. Sometimes when coping them from a website they are not formatted correctly and you have to replace them all with single quotes ( ‘ ).

    #910420
    Donna
    Participant

    So, I did a staging site this time cause I didn’t want to break the site again and re-did the quotes, that didn’t help I get:
    Parse error: syntax error, unexpected T_STRING in /nas/wp/www/staging/indiebusiness/wp-content/themes/streamline/functions.php on line 411
    Here’s what’s being put in if you can see what may be wrong?

    /**
     * A function which adds a shortlinks button for ‘portfolio’ post type
     */
    function wptuts_shortlinks_for_portfolio( $shortlink, $id, $context ) {
     
        // Context can be post/blog/meta ID or query
        $post_id = 0;
     
        if ( ‘query’ == $context && is_singular( ‘tribe_events’ ) ) {
     
            // If context is query use current queried object for ID
            $post_id = get_queried_object_id();
     
        }
        elseif ( ‘post’ == $context ) {
     
            // If context is post use the passed $id
            $post_id = $id;
     
        }
     
        // Only do something if of portfolio post type
        if ( ‘tribe_events’ == get_post_type( $post_id ) ) {
            $shortlink = home_url( ‘?p=‘ . $post_id );
        }
     
        return $shortlink;
    }
    add_filter( ‘pre_get_shortlink’, ‘wptuts_shortlinks_for_portfolio’, 10, 3 );

    #911586
    Brian
    Member

    Not sure what line it is referring to with the error. However, the coding looks right, but it could be a formatting issue with the quotes. When you copy and paste sometimes they get formatted incorrectly. Try replacing each quote with a new single quote.

    Let me know if that helps.

    Thanks

    #914223
    Donna
    Participant

    As I mentioned in the previous ticket I did replace the quotes 2x, once in the text edit file and when that still broke the site I pasted the code in the site directly and switched them out right in the file.

    #914343
    Brian
    Member

    Shortlink
    Oh my bad sorry for missing that. Sorry it is not working I did not run into issues when placing it on my site so I am not sure where the issue is coming from. Unfortunately, that is the only solution we have for that issue it is 3rd party coding and we cannot troubleshoot every step on integration. We provided a snippet to try and help out, but that is as far as we can provide support for it.

    Next Month Link
    As for the Next Month Link not showing you can add this snippet:

    https://gist.github.com/elimn/67679b0b9b74793a53f0

    To your theme’s function.php to try and resolve that.

    If you are still having issues with that I can still help out with it.

    Thanks

    #914510
    Donna
    Participant

    I’m not so concerned with the “next month” as I am with the inability to share events posted on your calendar. Do you recommend a social sharing plugin that does work with your calendar or a calendar that works with social sharing plugins?

    #914739
    Brian
    Member

    I have used the Genesis Simple Share Plugin in the Past:

    https://github.com/copyblogger/genesis-simple-share

    I used this snippet to place the share buttons above the Event Content

    https://gist.github.com/jesseeproductions/c7441fe7e08a5c9cd64e

    That may work for you as well.

    #914750
    Donna
    Participant

    I finally pinpointed it https://wordpress.org/support/plugin/jetpack-extras is breaking it – ugh I’m sorry we’ve been using this for years something must have recently snapped on it.

    #915190
    Brian
    Member

    I am glad to see you were able to fix this issue.

    Since the issue is resolved I am going to go ahead and close this ticket. If you have a similar issue or another in the future, please do not hesitate to create a new ticket.

    Thanks!

Viewing 14 posts - 1 through 14 (of 14 total)
  • The topic ‘Glitchy Next Month and twitter’ is closed to new replies.