Facebook Like Button Post to Facebook Box is Not Showing Properly? - css

I am Using the XFBML of Social Plugins I created the Popup For this and Place the XFBML Code For Testing. Like Button is Working Fine. After Like Post to Facebook Box is not Appearing Properly. I am Not Sure Why this Happening. I attached the Screenshot for this one
Any Suggestion Would Be Great. I am Using this code on Wordpress Site.
Thanks in Advance.

Try to turn off "sending" and "show faces" functions for it. XFBML code should thendisplay the button look something like this:
<fb:like href="yoursite.com" send="false" layout="box_count" width="150" show_faces="false"></fb:like>
Other thing could be that the FB button is partially overlayed by another layer. Try to wrap the code above to <div></div>, create a class for this div like that <div class="myclass"></div> and then use a z-index css property like this:
.myclass {
z-index: 1;
}

Related

how to hide half the homepage with a show more button WORDPRESS

So I have been searching for a good plugin but was unable to find any - On the homepage of the WP website that I am working on, I want to hide half the page and want to add a button and in middle of the page at the end of the first half that would say "Show More" - When the visitor clicks that button, the rest of the page should show. The button would then go to the end of the page saying "Show Less". The page is static and is just some text and images, nothing complex.
You can do this putting a html block and writing:
<!--nextpage-->
you can read more about this on:
https://codex.wordpress.org/Styling_Page-Links
and to get other solutions you can try:
https://es.wordpress.org/plugins/automatically-paginate-posts/
https://es.wordpress.org/plugins/sgr-nextpage-titles/
https://es.wordpress.org/plugins/page-links-single-page-option/
I hope this will help you to get what you want.
You must create a div with css display none. And then in your html code put an element with a jquery behaviour to display the previously div created. It will be something like:
$(document).ready(function(){
$('#show_content_button').click(function(){
$(this).hide();
$('#content_hide_on_home').show();
});
$('#hide_content_button').click(function(){
$('#show_content_button').show();
$('#content_hide_on_home').hide();
});
});
#content_hide_on_home { display:none; }
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<p>Text on home</p>
Show content
<div id="content_hide_on_home">
Your extra content on home
Hide content
</div>
I hope this is what you're searching.

How to add "unlike" button in web page?

I am working on Windows 8 App where I need to show a web page with facebook "Like/Unlike" options. Below is code which I added for Like.I need to add Unlike option too. Can some one explain me how to get this done ?
#section AdditionalHeaderContent {
<script type="text/javascript" src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script>
}
#section ContentFooter
{
<div id="fb-root">
<fb:like ref="#Url.RequestContext.HttpContext.Request.Url.ToString().EnsureTrailing("/")" show_faces="true" width="450"></fb:like>
</div>
}
How can I show "unlike" button?
Thanks.
The Facebook like button also is your Facebook unlike button. The Facebook button knows if you already liked the page.
So when you click on it again you are "unlike-ing" it again.
*update * *(so you do not have to check the comments)*
This button uses Javascript that has been hosted by facebook, you can not edit that.
----- What you can do ----
If it is possible to make a custom separate Like and "Unlike" button this would be the way to do it.
Use the c# Facebook SDK to code things for Facebook yourself.
( http://csharpsdk.org/ )
You can look up the Facebook API here.
( https://developers.facebook.com/docs/reference/apis/ )

How to disable web content appears in iframe of slide in iframe element?

see the snap shot and you will understand what i mean.
You should locate the iframe on the page using your browser's code inspection (CTRL + U generally), and then use jQuery (because its convenient) to remove it. So you should add a script like that in your page: $(function() { $('#pubPath').remove(); }); or switch to another website.

how to get google translate for section with dropdown list of languages working?

I'm trying to use google translate for translations of user comments. I'm using the official wizard (http://translate.google.com/translate_tools) to generate the java script and html code:
<script>
function googleSectionalElementInit() {
new google.translate.SectionalElement({
sectionalNodeClassName: 'goog-trans-section',
controlNodeClassName: 'goog-trans-control',
background: '#f4fa58'
}, 'google_sectional_element');
}
</script>
<script src="//translate.google.com/translate_a/element.js?cb=googleSectionalElementInit&ug=section&hl=auto"></script>
<div class="goog-trans-section">
<div class="goog-trans-control">
</div>
some text in some language
</div>
I don't want the entire page to be translated, but only the comments. Unfortunately, the code generated for section translation doesn't come with a dropdown box for language selection. Does somebody know how to implement this? I tried to add includedLanguages: 'en,fr,de,ru', to the java script code, but it didn't help.
The super simple thing is just use the steps below.
1. add the following code where you want to show the translate dropdown.
<div id="google_translate_element"></div>
<script>
function googleTranslateElementInit() {
new google.translate.TranslateElement({
pageLanguage: 'en'
}, 'google_translate_element');
}
</script>
<script src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>
add class="notranslate" to body tag
add class="translate" to the section which you want to be translated by google translate.
It seems the sectional translation widget behaves differently to how I was expecting (and maybe differently to how you were expecting too). The "entire webpage" widget gives you a dropdown and lets the user choose which language they want to display the page in.
The "section of the webpage" widget appears to be intended to deal with sites which have individual sections in different languages where you want the user to be able to translate those sections into your primary page language. This becomes clear when you click the "Preview your page" link on the official wizard.
If you look at the generated markup you will see that you mark up sections of the page something like this:
<div class="goog-trans-section" lang="zh-CN">
...content in Chinese...
</div>
The script then automatically appends a "Translate" link which allows you to translate this text back into English.
To achieve what I wanted (and what I guess you were trying to do too) I needed to stick to the "entire webpage" snippet but add a class of notranslate to anything that I didn't want to be translated.

Opening Pages in New Window

Is there a way to open a page in XHTML without using <a href="page.html" target="_blank"> that is standards compliant?
I'm not using frames, but there are some pages that I want to open in a new window instead of the current one.
You can use javascript's window.open() method. However this could easily be blocked by a pop-up blocker. Why do you not want to use the "_blank" target?
You can use something like this:
My Page
And then you run this jQuery:
$(document).ready(function() {
$('a[rel="external"]').attr('target', '_blank');
});
This will add the target="blank" to the links and make your HTML validate :)
Most pop-up blockers wont block a pop up that has been requested by the user e.g you click a link and it pops up a window. IF you add an onlick event to your link and a target, the desired effect will work even if JS is turned off although you don't want to use target="_blank"

Resources