Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #22843

    I’m hoping someone can help me out. I’ve been desperately trying to get social icons (specifically facebook) to load in a portfolio while using AJAX for the portfolio style. Some plugins will get close and will add other dynamic social buttons, just not facebook.

    Does anyone know of a plugin (or workaround) to achieve this?

    #117460

    Hi,

    Maybe you can try http://wordpress.org/extend/plugins/wp-socializer/. It has shortcodes for all kinds of social icons so you can easily integrate them on the ajax portfolio.

    Regards,

    Ismael

    #117461

    Thanks Ismael –

    wp-socializer is a great plugin and easy to place wherever you’d like, however I can’t seem to get it to appear on an AJAX portfolio entry.

    On a non-ajax entry it appears perfectly. any suggestions on how I can get it to appear in the AJAX entries?

    Thanks -

    TS

    #117462

    Hi,

    Edit functions-replete.php and find this code block

    //check if the portfolio item was requested by an ajax call and returns that
    if(!function_exists('avia_check_ajax_request')){

    add_action('wp_ajax_avia_check_portfolio', 'avia_check_ajax_request');
    add_action('wp_ajax_nopriv_avia_check_portfolio', 'avia_check_ajax_request');

    function avia_check_ajax_request()
    {
    if(!isset($_POST['avia_ajax_request'])) return false;

    global $avia_config, $more;
    $avia_config['avia_is_overview'] = false;
    $avia_config['is_ajax_request'] = true;

    $id = $_POST['avia_ajax_request'];

    global $post;
    $post = get_post( $id );
    setup_postdata($post);

    $more = 0;
    $slider = new avia_slideshow($id);
    $slider -> setImageSize('fullsize');
    $slider_html = $slider->display();

    echo "<div class='ajax_slide ajax_slide_".$id."' data-slide-id='".$id."' >";

    echo "<div class='inner_slide'>";

    echo "<div class='flex_column two_third first'>";
    echo $slider_html;
    echo "</div>";

    echo "<div class='portfolio-entry one_third'>";
    echo avia_title(array('class'=>'portfolio-title', 'html' => "<div class='{class} title_container'><h1 class='main-title'>{title}</h1></div>"), $id);

    echo "<div class='entry-content'>";
    $meta = avia_portfolio_meta($id);
    if($meta)
    {

    echo $meta;
    echo avia_advanced_hr(false, 'hr_small');
    }

    the_content(__('Read more','avia_framework').'<span class="more-link-arrow"> &rarr;</span>');
    echo "</div>";

    echo "</div>";

    echo "</div>";

    echo "</div>";
    unset($avia_config['is_ajax_request']);
    die();
    }
    }

    You can insert the shortcode for the socializer somewhere inside. Maybe above this line of code.

    the_content(__('Read more','avia_framework').'<span class="more-link-arrow"> &rarr;</span>');

    Regards,

    Ismael

    #117463

    Thanks Ismael – it’s almost working!

    The problem now is that the buttons are not referencing the correct link to “like”. For the icons that I can get to show up (only ones without counters seem to work), they send along “admin-ajax.php” instead of the individual portfolio entry page. any ideas?

    #117464

    I’m getting closer…

    I switched to the Social Sharing Toolkit plugin, and I’m able to add it to the portfolio items without needing to edit the functions-replete.php file. Lots of social icons come up, and the links point to the unique portfolio item url (yes!!!).

    Now the only issue: Facebook and Twitter are the the only ones that do not show up, and they happen to be the only ones I want to see!

    I feel like this is something simple that I’m missing. Does anyone have a remedy for this?

    #117465

    Hi,

    Go to the Social Sharing Toolkit > Settings > Content then check Facebook and Twitter. Also on General Settings > Button locations > Select your preferred location. It works on my end. Nice plugin by the way.

    Regards,

    Ismael

    #117466

    Thanks Ismael – I followed all the steps you mentioned and wasn’t able to get it to work. Even on a clean install with no other plugins.

    Is your portfolio set to ajax? The closest I can get is having them load in the except under the portfolio thumbnail images, but not within the view of the portfolio item itself.

    TS

    #117467

    Hi,

    Yeah, sorry, I wasn’t able to make it to work on Ajax portfolio. Probably javascript conflict. Let me tag the rest of the support team. I’m running out of ideas on how to make this social shortcodes work inside the ajax portfolio.

    Regards,

    Ismael

    #117468

    Hi,

    I dealt with a similar problem and I think we decided that the easiest way to do it would be to do it like this http://goo.gl/7eKl2 .. click on the portfolio item and it will open up ajax and you will see the social buttons. http://wordpress.org/extend/plugins/addthis/ was the plugin

    Otherwise you will get a headache.

    Thanks,

    Nick

    #117469

    Thanks for the advice Nick – The issue I see with that plugin is the buttons do not link to the individual portfolio entry (and therefore do not promote the individual portfolio item).

    **** BEST REMEDY (SO FAR) ****

    Still using the Social Sharing Toolkit plugin, I went with Facebook Share (rather then Like) and Twitter, and set them both to ‘Icon’ view (no counters). The main issue seems to be when it tries to load the counters, it breaks. So even though it doesn’t display the number of likes, etc., it will still promote the individual portfolio item.

    While not perfect, this will work fine enough for my needs. Thanks again for all the help!

    TS

    #117470

    Hi,

    Here is a way to get the number of likes to show with addthis http://stackoverflow.com/a/11962442/1245478

    Thanks,

    Nick

    #117471

    Hey,

    Glad we could help.

    Regards,

    Ismael

Viewing 13 posts - 1 through 13 (of 13 total)

The topic ‘social icons within ajax portfolio’ is closed to new replies.