Home Forums Newsletter Plugin Support do_shortcode

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #27732
    Totoleheros
    Participant

    Hello,

    I have modified the theme.php and theme-option.php files to add an option so that I can include recent events listed with the ‘Event List’ plugin I am using (https://wordpress.org/plugins/event-list/).

    In the theme.php file, in the ‘global $newsletter, $post;’ section, I have added this code:

    if (!empty($theme_options[‘theme_events’])) {

    $var1 = do_shortcode( ‘[event-list cat_filter=upcoming-events date_filter=upcoming initial_order=asc show_filterbar=false]’ );
    }
    if (!empty($theme_options[‘theme_eucalls’])) {
    $var2 = do_shortcode( ‘[event-list cat_filter=eu-calls date_filter=upcoming initial_order=asc show_filterbar=false]’ );
    }

    and the new conditional var1 and var2 are displayed in the newsletter with echo $var1 and echo $var2 (if the option theme_events and theme_eucalls have been checked in the option file).

    Everything seems to work well: the newsletter is nicely displayed on the screen. My trouble is that links to the events listed in the NL are not correct.

    For instance, they should be like: http://mysite.com/news/events/?event_id1=64 (and if I use the content of the shortcode above in a page, the Event List plugin returns the correct links)

    And instead they are like that in the NL: http://mysite.com/wp-content/plugins/newsletter/emails/create.php?preview=true&event_id2=64

    As a result, the following message is displayed when the link in the NL is clicked:

    No logged in user found. A plugin is almost surely removing the authentication cookies, usually a cache plugin. Try to report the issue on https://www.thenewsletterplugin.com forum.

    Can you help me, is there a way to have the links properly formed in the NL? (I understand that this request is above the normal support since I am trying to add a new customized option to your plugin).

    Thank you very much in advance.

    AN

    • This topic was modified 5 years, 8 months ago by Totoleheros.
    #27861
    Totoleheros
    Participant

    Any chance that someone has an idea to help me resolve this issue? Many thanks in advance for any contribution.

    Best

    AN

    #27872
    Totoleheros
    Participant

    Hi,

    I found the way to get the right links by modifying the way my variables are calculated:$var1 = do_shortcode( ‘[event-list cat_filter=upcoming-events date_filter=upcoming initial_order=asc show_filterbar=false url_to_page=http://mysite.com/news/events/]’ );

    Now, everything is working perfectly…

    Best

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.