i want share on wordpress a special text on someones personal timeline if he clicks "share".
f.e i have: "oh god, iam pregnant"
exact this text i want post on my or his facebook timeline from the coded website. it should see as i or he typed this (no link to website, or anything, blank text) on facebook. its similiar to copy & paste, but share would be easier.
i found this, but this is static, and i work with wordpress and generate multiple random text for the user with posts.
<script type="text/javascript">
$(document).ready(function(){
$('#share_button').click(function(e){
e.preventDefault();
FB.ui(
{
method: 'feed',
name: 'This is the content of the "name" field.',
link: 'URL which you would like to share ',
picture: ‘URL of the image which is going to appear as thumbnail image in share dialogbox’,
caption: 'Caption like which appear as title of the dialog box',
description: 'Small description of the post',
message: ''
}
);
}
);
}
);
</script>
a plugin is great too
thank you
What you want to do is not allowed according to the platform policy:
Don't prefill captions, comments, messages, or the user message
parameter of posts with content a person didn’t create, even if the
person can edit or remove the content before sharing
Even if it would be allowed, the only way to do this is to authorize a user with the publish_actions permission and use the API to post to the user wall. You would not get publish_actions approved for this, so it´s not possible at all.
Just to make this clear: The message must be 100% user generated.
Related
I encountered a problem while sending a link to my new Wordpress site to a friend. While the link on every other platform shows exactly the same description, as it should. Discord, on the other hand, puts author above description so that when the link is sent it sais:
[mydomain.com]
admin
[description]
It is not that much of a problem but I think that it should not take a place, especially when I often link lot of things on discord.
Adding this block of code to your wordpress functions.php (use child theme if necessary)
This is the shortest method of removing the data that discord pulls in though it will remove the data from being view from every site that wants to embed a link.
/* Disable oEmbeds author name & author url ~ Stops Showing in embeds */
add_filter( 'oembed_response_data', 'disable_embeds_filter_oembed_response_data_' );
function disable_embeds_filter_oembed_response_data_( $data ) {
unset($data['author_url']);
unset($data['author_name']);
return $data;
}
Note this was taken from another post on stackOverflow and isnt my own code : there is also a more compliacted solution on this thread as well. original post
This can also have so negative effects on SEO due to not sharing the data, and we all know google loves data.
An alternative solution is to set the author of the post to the site name rather than the admin user.
Side note you really should change your username from admin to something less generic so a potentual hacker has to work out the username as well as the password.
I would like to modify my WordPress/WooCommerce website, so that my Product Images have the following conditions:
Logged in site visitors:
I would like logged in visitors, to be able to see all of the WooCommerce Product Images.
Logged out site visitors:
I would like logged out visitors, to see an alternative image. Therefore, hide the Product Image. This alternative image, will be the same for every Product.
Firstly, you are going to need to create a Child Theme, for your WordPress/WooCommerce website.
Once created, simply insert the following code, into the functions.php file, within your Child Theme:
<?php
// Remove Default WooCommerce Product Images/Placeholders.
remove_action( 'woocommerce_before_single_product_summary', 'woocommerce_show_product_images', 20 );
// Create conditional logic function.
function logged_in_images(){
// If site visitor is Logged in, display Default WooCommerce Product Images/Placeholder.
if ( is_user_logged_in() ) {
echo woocommerce_show_product_images();
}
// If site visitor is not logged in, display the following Image instead.
else {
echo '<img src=http://vaporcenter.be/theme/Wholesale/img/placeholders/default.jpg?1504084579>';
};
}
// We are inserting ('Hooking' into) the above function into where the Default WooCommerce Product Image/Placeholder was, before we removed it.
add_action( 'woocommerce_before_single_product_summary', 'logged_in_images', 20 );
?>
Be sure to replace http://vaporcenter.be/theme/Wholesale/img/placeholders/default.jpg?1504084579 with your desired image.
Don't forget, you can remove the comments (// ...) from the code. They are there, to just help explain what is happening.
I have tested the above code and it does work.
Best of luck!
If you receive an error
Step One: Using an FTP client, such as Filezilla, go into your Root Folder (Where you installed WordPress).
Look for a file entitled wp-config.php and drag this to your computer.
Open the file, using Notepad/Notepad++ and look for the line define('WP_DEBUG', false); and change 'false' to 'true'.
Drag the wp-config.php file back from where you got it from.
Refresh the page you are having an issue. You should then see an error message, which will be helpful in addressing how to resolve any issues.
Once you have resolved your issue, and your website is back in working order, head back into your wp-config.php and change 'true' back to 'false'.
I run a Wordpress website. I have many users who have content of their own.
I want to add this feature: if one user wants to see another user's content, then the user (who wants to see) has to Like the other user's Facebook page.
Is there any plugin to do this?
I am currently using this code by Patrik from Stack Overflow:
FB.api({
method: "pages.isFan",
page_id: page_id,
}, function(response) {
console.log(response);
if(response){
alert('You Likey');
} else {
alert('You not Likey :(');
}
}
);
But I actually need to also integrate user_id.
Note: I can get user id from get_the_user_id() function; I only need to integrate it.
Like-Gating is not allowed any more by Facebook – and therefor they have removed all easy means to check whether the user likes a certain page.
You must present the same content to all users, whether they liked a specific page or not.
I'm working on a Charity site where we want to accept membership payments and donations via paypal.
I am having a problem with Contact Form 7 and redirection to PayPal with a variable payment amount. I'm really hoping that someone can assist or shed some insight on this problem for me.
I read This Post, which made it sound quite easy but, while my email is being sent, the form isn't redirecting to PayPal, in fact it's not doing anything at all, not even giving me the "thank you your form has been submitted" notice.
my form has this line: £[text* AmountPaying 6/ id:PayingThis]
And under "Additional Settings" I have inserted this:
<script>
function my_redirect() {
var price = document.getElementById("PayingThis").value;
var url = "https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=#####¤cy_code=GBP&amount="+price+"&return=http://www.example.org/join-or-renew-your-membership-online/";
window.location = url;
}
</script>
on_sent_ok: "my_redirect();"
does anybody have any experience with this ?
Thanks for the comments !
With some help troubleshooting from a friend I have figured out how to make this happen with contactForm7 - in fact, I believe you could extend this solution, and submit a lot of dynamic information directly to PayPalmy problem.
This is what I did - and it's essentially the same as this guy does here
BUT, instead of putting that code in the "ADDITIONAL SETTINGS" Area of the CF7 Form page - I added this:
<script>
function my_redirect() {
var price = document.getElementById("PayingThis").value;
var url = "https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=#######¤cy_code=GBP&amount="+price+"&return=http://www.example.org/join-or-renew-your-membership-online/";
window.location = url;
}
</script>
up at the top, with the rest of the Form building html and tags, just before the code for the form itself:
Your Name (required): [text* your-name]
etc.
and then in the Additional settings box.. I only called the function
on_sent_ok: "my_redirect();"
and it worked! it takes the value the user enters in the "How much do you want to give us" box, and submits it to paypal
I hope others can benefit from this
thanks again for taking the time to view and help
-5tratus
Contact Form 7 is a great plugin but creating a form for PayPal gets a little tricky. Gravity Forms would be a great options but you would need the developers license that cost $200.
My recommendation is to look up the PayPal form API and create the form yourself, from scratch and integrate it OR you should have a look at the Advanced Custom Fields plugin, and the PayPal Field Add-on for Advanced Custom Fields! It's all free.
It enables you to set a form on any post/page/etc with a paypal button. All you have to do is add the <?php the_field('NAME_OF_YOUR_FIELD'); ?> to your template, wherever you want to display it.
http://wordpress.org/plugins/advanced-custom-fields/
http://wordpress.org/plugins/advanced-custom-fields-paypal-field/
Thanks 5tratus. Works.
An old support thread (https://wordpress.org/support/topic/contact-form-7-paypal-integration-1) was getting as far as redirecting to PayPal, but then PayPal was giving an "Page Not Found" "You have requested an outdated version of PayPal" message.
I didn't need price or any extra variables, so I cleaned it up to just redirect to the product page. Here's what I used and it works:
<script>
function my_redirect() {
var url = "https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=[PUT YOUR BUTTON ID HERE]";
window.location = url;
}</script>
As 5tratus says, put the above code in at the bottom of the form code itself, then put
on_sent_ok: "my_redirect();"
in the "additional settings" part.
Refer this useful plugin - https://wordpress.org/plugins/contact-form-7-paypal-extension/
This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
How does Facebook Sharer select Images?
I've added a facebook "like" button on my site (I know, pretty sad).
However, my main logo is just text (styled with #font-face) which, I think, is a good thing since it's small and more accessible etc.
When someone clicks "like" and chooses to post this action to their wall, the only image facebook finds is a twitter icon. Is there some way I can trick facebook into using a different image as the default image for my site. I've tried adding an image but using CSS to not display it, but it didn't work.
Any other ideas?
Update:
opengraph looks like the way to go. However I tried it and it still isn't picking up my icon. Can you spot any mistakes in my meta tags? stolencamerafinder.com
Solved:
opengraph works fine. (If data is stale, use facebook's linter to update their cache)
add this meta tag
<meta property="og:image" content="http://ia.media-imdb.com/rock.jpg"/>
more here https://developers.facebook.com/docs/opengraph/
Go here for more description
You can call this function rather than share and customize your share.
You have to use Fb init with it.
function post_to_fb() {
FB.ui({
method: 'feed',
name: 'share',
link: 'share link',
caption: 'caption',
description: description,
picture: 'image link',
message: ' text'
}, function(response) {
if (response && response.post_id) {
}
else {
}
});
}