Jump to content
Sign in to follow this  
bisharata

Facebook Social plugin

Recommended Posts

bisharata

Has anyone had any issues with this plug in? Mine is pretty erratic--sometimes it works, sometimes it doesn't seem to want to load on my site. Can anyone explain why this is? I have two plug-ins from the Facebook Social pack on my site currently: the like button (appearing at the end of posts), and the recommended article plugin (on the sidebar). Sometimes they show up, sometimes they don't. I don't get it. If anyone can tell me if I'm doing something wrong, I'd be very appreciative! http://eveningsends.com/

Share this post


Link to post
Share on other sites
catrina

Have you tried deactivating the other plugins you have? There might be a conflict between them and your Facebook plugins (or even between the Facebook Like button plugin and the recommended article plugin).


Please read the docs before posting. Please do not private message me unless I ask you to.

Designer | Catrina Dulay

Founder | Catrina and Mouse

Share this post


Link to post
Share on other sites
ricardo

Andrew, FSP was last updated 1 year ago. I highly doubt you are doing something wrong and I'm kind of surprised it still works as FB keep themselves pretty busy updating and changing their API. I have used others but I keep coming back to Otto's Simple Facebook Connect. Ricardo

Share this post


Link to post
Share on other sites
bisharata

Ricardo Yes, that is working ... I have one question now, however. I want to get the "share" and like" widgets working, but if I choose (in Settings) to place the share/like buttons before or after every post, then they also appear in my webpage's feature slider (which I don't want). I'd like to install them manually by adding them to the universal sidebar (which I have designated in my template section as appearing after a the content area of my posts). However, I'm unclear how to get the text into this widget/universal sidebar. The instructions given in the Settings say: Manually add the button to your theme or posts (use the sfc_like_button function in your theme) But I have no idea what this means! I tried cutting and pasting text from the code itself, but I wasn't sure what to cut and paste. Maybe this was wrong? Any insight?

Share this post


Link to post
Share on other sites
ricardo

Yes, copy the template.postloop.php file from platformpro to platformbase, edit it and look for the_content for example. Then past the code given (should be something like

<?php sfc_like_button(); ?>

) where you want the button to appear. Ricardo

Share this post


Link to post
Share on other sites
bisharata

Hi Ricardo Helpful. This is all a bit above my head, but I am learning. I haven't tried messing around with the code yet, and have spent the last couple of days watching tutorials and trying to learn about how this works. I found this video helpful http://www.pagelines.com/docs/base-child-theme I have a question about your above instructions, however: You say "copy the template.postloop.php" file from platform pro to platformbase. What do you mean by this, exactly? Do I copy the entire postloop code and paste it into the Theme Functions (functions.php)--which is found under PlatformBase? Then, there, I add the like button code under the pagelines_loop_after_post_content hook? Or, do I just copy that one section? Or do I somehow start a whole new file under the base theme, and copy the pagelies post loop there? (and if so, how do I do that in the dashboard editor?)

Share this post


Link to post
Share on other sites
bisharata

Here is my stab at writing the code I'd need. How does this look, and would I just cut and paste what I've written below into the functions.php file in my Editor? // add_action(pagelines_inside_bottom_theloop','add_facebook_icons); // ---> uncomment to load //add_action('pagelines_inside_bottom_theloop, 'add_facebook_icons); // function name function add_like_to_posts(){ <?php sfc_like_button(); ?> <?php sfc_share_button(); ?> } // end function

Share this post


Link to post
Share on other sites
catrina

The code looks good, but

'add_facebook_icons
needs another apostrophe at the end (for both instances). Also,
add_like_to_posts
needs to be
add_facebook_icons


Please read the docs before posting. Please do not private message me unless I ask you to.

Designer | Catrina Dulay

Founder | Catrina and Mouse

Share this post


Link to post
Share on other sites
bisharata

Well, I made those changes, and now I get this! Parse error: syntax error, unexpected '<' in /home/content/53/7555653/html/wp-content/themes/platformbase/functions.php on line 87 please help. How do I undo this?

Share this post


Link to post
Share on other sites
bisharata

I can't navigate anywhere on my site, or anywhere in my dashboard ...

Share this post


Link to post
Share on other sites
bisharata

OK, I deleted the code I entered through my host server's ftp file ... and now the site is back up and working ... but still, I haven't figured out how to get the like button code into the loop ...

Share this post


Link to post
Share on other sites
kastelic

Your getting close man, don't give up! The problem is that your opening a new

<?php
tag when it is already open. So just remove all instances of
<?php
and
?>
from your code. Only if you want to output some HTML and don't want to use the php "echo" command would you first close the php tag
?>
and after the HTML has been typed out open it again
<?php
. If your putting a snippet of php within a bunch of html, then you would use the tags to open and close like
<?php my_function() ?>

and resume the html code.

Share this post


Link to post
Share on other sites
bisharata

I tried entering the cod, sans php tags, and now my site is jacked ... http://eveningsends.com/ I have no idea what to do. Of course, I deleted the code from the format.php in the base theme, but that didn't change it back!

Share this post


Link to post
Share on other sites
kastelic

Format.php? You should be placing the code in functions.php. Try switching your theme back to Platform Pro, and then reuploading functions.php so that you've overwritten any changes you made. THen you can switch it back and try again, just make sure you don't have any syntax errors.

Share this post


Link to post
Share on other sites
bisharata

no, that's what I meant ... functions.php sorry, I did place the code in functions.php, and then this catastrophe happened! How can I fix it? Like I said, I deleted the code and it had no effect.

Share this post


Link to post
Share on other sites
kastelic

Disable all plugins, especially your caching plugin. You should disable caching before you make edits to any of your files in the future as well.

Share this post


Link to post
Share on other sites
bisharata

OK, I disabled all plug-ins, and the website looks back to normal(ish) ... now what? Do I turn them on, one by one?

Share this post


Link to post
Share on other sites
bisharata

Jimmy It was probably the WP super cache plug-in that I had just installed today ... that was turned on. I have it turned of still. Should I try again to get this Like button to appear within the postloop?

Share this post


Link to post
Share on other sites
bisharata

OK ... so, I'm trying to get this LIKE button to work without it blowing up my site. I've cut and paste the function.php text in its entirety from my base theme, and at the bottom of what was already there, I've added the code that I would add at the bottom. Is this right? Should I actually add this and actually hit "update file"? <?php // Setup -- Probably want to keep this stuff... // Set up action for section registration... add_action('pagelines_register_sections', 'base_sections'); /* Hello! First, lets load the PageLines core so we have access to the functions */ require_once(TEMPLATEPATH . "/core/core.init.php"); // For advanced customization tips & code see advanced file. //--> require_once(STYLESHEETPATH . "/advanced.php"); // ==================================================== // = BASE FUNCTIONS - Where you should add your code = // ==================================================== // ADDING CUSTOM SECTIONS ------- // // Register a Drag&Drop HTML Section for the admin. // A pullquote section was created here for demonstration purposes // Sections should be named: section.[your section name].php and placed in the sections folder. function base_sections(){ /* Your custom sections get registered in here... PageLines Register Section Arguments: 1. Section Class Name, 2. Directory name (or filename if in root of 'sections' folder), 3. Init Filename (if different from directory name), 4. Section setup and variable array */ pagelines_register_section('BasePullQuote', 'pullquote', null, array('child' => true) ); pagelines_register_section('BaseSidebar','sb_base', null, array('child' => true) ); } // ABOUT HOOKS --------// // Hooks are a way to easily add custom functions and content to the Platform theme. There are hooks placed strategically throughout the theme // so that you insert code and content with ease. // HOOKS EXAMPLE --------// // Below is an example of how you would add a social media icon to the icons in header (branding section) // We have placed a hook at the end of the icon set specifically add new icons without modifying code or having to worry about your edits // getting thrown out during the upgrade process. The way to use hooks goes a little like this: // add_action('hook_name','function name'); // ---> uncomment to load //add_action('pagelines_branding_icons_end', 'add_icons_to_branding'); // function name function add_icons_to_branding(){ // This hook adds a stumbleupon icon to the header of your theme. The class referenced in the link can be seen in the style.css // and is the image from the CSS is placed in the images folder ?> <?php } // end function // ADDING NEW TEMPLATES --------// // Want another page template for drag and drop? Easy :) // 1. Add File called page.[page-id].php to Base // 2. Add /* Template Name: Your Page Name */ and Call to 'setup_pagelines_template();' to that file (see page.base.php) // 3. Add 'pagelines_add_page('[page-id]', '[Page Name]');' to this functions.php file // Add Base Page pagelines_add_page('base', 'Custom Page'); // OVERRIDE SECTION TEMPLATES --------// // Want more customization control over any of the core section templates in PlatformPro? Just override the template file. // To do that, just add a file called template.[section-id].php to this child theme and it will override the section templates // for the section with that ID. For example, template.boxes.php will override the boxes templates. // Once overridden you can copy the code from that section, paste it there and edit to your heart's content. // add_action('pagelines_inside_bottom_theloop','add_facebook_icons'); // ---> uncomment to load //add_action('pagelines_inside_bottom_thelood', 'add_facebook_icons'); // function name function add_facebook_icons(){ sfc_like_button(); sfc_share_button(); } // end function

Share this post


Link to post
Share on other sites
bisharata

(oh yeah, with Super Cache et al turned off!)

Share this post


Link to post
Share on other sites
ricardo

Uncomment // add_action('pagelines_inside_bottom_theloop','add_facebook_icons'); Or in other words, remove the double forward slash from the beginning of the lines You also have a typo in the other similar action, it says pagelines_inside_bottom_thelood

Share this post


Link to post
Share on other sites
bisharata

So, like this?

	Uncomment
	//add_action('pagelines_inside_bottom_theloop','add_facebook_icons');
	
	// ---> uncomment to load
	//add_action('pagelines_inside_bottom_theloop', 'add_facebook_icons');
	
	// function name
	function add_facebook_icons(){
	
	sfc_like_button();
	
	sfc_share_button();
	}
	// end function

Share this post


Link to post
Share on other sites
ricardo

no, like this:

// ---> uncomment to load
	add_action('pagelines_inside_bottom_theloop', 'add_facebook_icons');
	// function name
	function add_facebook_icons(){
	sfc_like_button();
	sfc_share_button();
	}
	// end function
	

Share this post


Link to post
Share on other sites
bisharata

Dude ... IT WORKED!!!! Thank you!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

×