Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #719820

    Helle Everybody
    id like to have your social-share buttons somewhere in every single-event.
    Example:

    This post-type comes from “Events Calendar” from Modern Tribe

    Yeet recommended this solution but it doesnt work:

    add_filter('avf_builder_boxes', 'add_builder_to_posttype');
    function add_builder_to_posttype($metabox)
    {foreach($metabox as &$meta)
    	{if($meta['id'] == 'avia_builder' || $meta['id'] == 'layout')
    		{$meta['page'][] = 'events';}}
    	return $metabox;}

    I tried “events” as well as “event” – but none of them did the job.
    I also flushed permalinks and the cache.

    If we can make the ALB work for this CPT i have to add the Social-Share-Element manually to appr. 300 posts.
    Is there a shortcut?
    Or maybe a way to make it default?

    Regards Marcus

    #720759

    Hey MarcusJeroch,

    Try using this code instead and add it to functions.php:

    add_filter('avf_builder_boxes', 'add_builder_to_posttype');
    
    function add_builder_to_posttype($metabox)
    {
      foreach($metabox as &$meta)
      {
        if($meta['id'] == 'avia_builder' || $meta['id'] == 'layout')
        {
          $meta['page'][] = 'tribe_events';
        }
      }
    }

    As for the shortcut in adding Social Share to each event, you can add this code in functions.php:

    function add_social_share() {
    	echo "<br>";
    	echo do_shortcode("[av_social_share title='Share this entry' style='' buttons='' custom_class='']");
    }

    Let us know if this helps. :)

    Best regards,
    Nikko

    #721692

    Hello Nikko
    sorry, but none of your suggestions worked.

    No errors occurred but nothing changed.
    No ALB , no share buttons as default

    This is the content of my functions.php

    <?php
    /*
    * Add your own functions here. You can also copy some of the theme functions into this file. 
    * WordPress will use those functions instead of the original functions then.
    */
    function enqueue_parent_theme_style() {
          wp_enqueue_style( 'parent-style', get_template_directory_uri().'/style.css' );
    }
    add_action( 'wp_enqueue_scripts', 'enqueue_parent_theme_style');
    
    /* Proper way to enqueue styles and scripts
     */
    function theme_name_scripts() {
    	wp_enqueue_style( 'style-name', get_stylesheet_uri() );
    }
    add_action( 'wp_enqueue_scripts', 'theme_name_scripts' );
    
    /* Activate Avia debug mode */
    add_action('avia_builder_mode', "builder_set_debug");
    function builder_set_debug()
    {
    	return "debug";
    }
    add_filter('avf_builder_boxes', 'add_builder_to_posttype');
    function add_builder_to_posttype($metabox)
    {
      foreach($metabox as &$meta)
      {
        if($meta['id'] == 'avia_builder' || $meta['id'] == 'layout')
        {
          $meta['page'][] = 'tribe_events';
        }
      }
    }
    function add_social_share() {
    	echo "<br>";
    	echo do_shortcode("[av_social_share title='Share this entry' style='' buttons='' custom_class='']");
    }

    Regards Marcus

    #722780

    Hi,

    Please post the login details here so that we can check it further. For the social share, please use this instead.

    add_action('tribe_events_single_event_after_the_content', 'tribe_events_single_event_after_the_content_mod');
    function tribe_events_single_event_after_the_content_mod() {
    	echo do_shortcode("[av_social_share title='Share this entry' style='' buttons='' custom_class='']");
    }

    Best regards,
    Ismael

    #723211

    Hi Ismael
    thanx, that worked.

    Since we solved that there is no need to make the ALB work for events.
    If i need it one day i`ll come back.
    Regards marcus

    #723717

    Hi Marcus!

    You mentioned you need further assistance. How can we help? :)

    Best regards,
    Yigit

    #723899

    Hello Yigit
    the code Ismael provided looks as if the share buttons will be echoed at the bottom of content:
    add_action(‘tribe_events_single_event_after_the_content
    In fact it ends up in another <div> and that causes that the boxes containing the eventdata will be pushed out of the visible screen if you look on a mobile phone.
    The only thing you see is the share buttons taking the whole screen-width

    I made a workaround by CSS but for sure this is not a clean solution.
    The CSS is:
    .shareva {
    clear: both;
    margin: 60px 0 170px 0 !important;
    position: relative !important;
    }

    Can you please help us to find a proper solution?

    Regards Marcus

    #725333

    Hi Marcus,

    Sorry for the late reply.

    Can you please post a screenshot showing the issue and a link to your page?
    You can upload your screenshots on imgur.com or Dropbox public folder and post the links here

    Best regards,
    Yigit

    #727983

    Hi Yigit
    screenshot shows this URL on a mobile:

    Here is the screenshot:
    https://drive.google.com/open?id=0B-VtEOLANbaCNl9tN1ZJb0V3Ync

    REMEMBER:
    I made a dirty work around with the CSS mentioned above and i removed the CSS specially for the Screenshot.
    Of couse i have to put the CSS back in charge again because i dont want my users to see crashed pages.

    Another Thing
    The Codes provided from Ismael and Nikko to add ALB to events do have two results:
    1: ALB does not show up in Events
    2: ALB vanished from Blogposts
    This of course is the wrong direction

    Regards Marcus

    #728345

    Hi,

    1.) The editor messed up the code so we edited it a bit. Please try it again.

    2.) Please post the login details in the private field so that we can check the event posts.

    Best regards,
    Ismael

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