I had links in my website which were working fine but I noticed that these are not working now.
eg : http://www.facebook.com/sharer/sharer.php?s=100&p[url]=http://www.otlcampaign.org/blog/2013/02/04/inconvenient-truth-education-reform&p[images][0]=http://www.otlcampaign.org/sites/default/files/journey-for-justice-mlk-memorial.jpg&p[title]=The+Inconvenient+Truth+of+Education+'Reform'!&p[summary]=Recent+events+have+revealed+how+market-driven+education+policies,+deceivingly+labeled+as+%22reform,%22+are+revealing+their+truly+destructive+effects+on+the+streets+and+in+the+corridors+of+government:
this link was working fine before but its not taking custom title , summary etc. Please help me to resolve this problem.
I'm not using meta tags because there are lot of share buttons which have different title, description, image urls.
I have already gone through existing question on this site but those solutions are obselete. eg Facebook Share doesn't show my description or my thumbnail
Any suggestions please.
I'm not sure if you're comfortable with using PHP, but have you tried the following?
<?php
$title=urlencode('Title');
$url=urlencode('http://www.facebook.com/yourfanpage'); /* Note Personal FB Pages will not work */
$summary=urlencode('Custom message');
$image=urlencode('http://www.yourdomain.com/facebookshare/images/customthumbnail.jpg');
?>
<a onClick="window.open('http://www.facebook.com/sharer.php?s=100&p[title]=<?php echo $title;?>&p[summary]=<?php echo $summary;?>&p[url]=<?php echo $url; ?>&&p[images][0]=<?php echo $image;?>', 'sharer', 'toolbar=0,status=0,width=548,height=325');" target="_parent" href="javascript: void(0)">
Share our Facebook page!
</a>
From your example, also, I noticed that one of the issues might be the ampersands. You have 100& instead of 100& You will need to double check all of the links for these and the spaces, etc.
In tumblr, is it possible to show only posts with a certain tag in the home page?
If so, how is it done?
I just wrote up the solution to the opposite problem here:
How to hide the posts with a given tag from the homepage.
You can take inspiration from there and implement the opposite. Alternatively, you can simply add a "hidden" tag to each one of the things that you don't want displayed on the homepage.
I know that this topic is quite old, but I figured I'd share what I did for anyone who is still looking for an answer to this problem.
First, paste the following code after the "</title>" in your theme HTML.
<meta name="text:Default Tag" content="" />
Next, right after the "<body>" in your theme's HTML, paste the following:
{block:IndexPage}<script type="text/javascript">
var url = location.href;
if (url == "{BlogURL}") {
window.location = "{BlogURL}tagged/{text:Default Tag}";
}
</script>{/block:IndexPage}
In your theme settings, you should see a box labeled "Default Tag". Put the tag you'd like posts to appear for in that box (without a hashtag) and click save.
Now, if someone visits your blog, it will forward them to the page that shows posts with your specified tag. Of course, this probably isn't the best way of doing it, but it's the best way I could come up with that wouldn't mess up themes.
Another thing I like about this way of doing this, is that you can send someone your blog URL with a "/?" appended to it (e.g. "myblog.tumblr.com/?") and it will show all of your posts.
Using mircealungu's suggestion worked perfectly for me! Here's how I did it:
1. Find the article tag, and add the classname:
class="notfeatured {TagsAsClasses}"
If it already has a classname, add the part in bold above inside the classname quotes. Mine ended up looking like this:
<article id="{PostID}" class="post notfeatured {TagsAsClasses} {PostType}{block:PermalinkPage} {block:Date}not-{/block:Date}page{/block:PermalinkPage}">
2. Find the div tag that precedes the article tag, and add the classname:
class="{block:TagPage} tag_page {/block:TagPage}{block:PermalinkPage}perma_page{/block:PermalinkPage}"
Again, if a class already exists, just add the part in bold above inside the classname quotes. Mine ended up like this:
<div id="posts" class="{block:TagPage} tag_page {/block:TagPage}{block:PermalinkPage}perma_page{/block:PermalinkPage}" >
3. Finally, add this to your CSS:
article.notfeatured {display: none;}
article.featured, .tag_page article.notfeatured, .perma_page article.notfeatured {display: block;}
Now any post tagged as "featured" will display on your home page, but nothing else. So far no issues for me, it works great! You can see it here.
You can also use javascript to reorder the display so you can make the featured posts appear first in a list. The script is very simple:
$('article.featured').prependTo('#posts');
And here is a demo. Just place that inside javascript tags and put it right before the /body tag in your theme. In this case don't use the CSS above, because you don't want to hide the posts. I implemented a .top class for the script and kept the .featured class for the CSS, and I use both the CSS and the script.
Tumblr’s Custom Themes don’t provide such a functionality.
You could use JS or CSS to (visually) hide all posts without a specific tag on the index page, but that way you won’t have the full 10 (or whatever you configured) posts per page anymore.
You could probably use Tumblr’s API to create a list of matching posts (with Javascript) and display that content instead of the default posts (so your custom theme would only contain the script for the index page content). You would have to make sure that the pager still works, though.
Actually, it is possible, but it might not work how you want.
1st. Identify the id of your individual posts (usually something like #post or #entry, lets call yours #entry)
2nd. Replace your opening post div with this:
2nd. Add this bit of css
{block:IndexPage}
#entry (or whatever name it is) {display:none}
.featured {display:inline !important}
{/block:IndexPAge}
3rd. Tag all the posts you want to show on your homepage without quotes as "featured"
This should work, but it will most likely hide all the non "featured" posts on your search page and tag page as well, which you may not want.
If you want your users to be directed to a specific 'splashpage' when they visit your blog, you could always use a jquery redirect script. Hope some of this helped!
Im sorry to say, with their existing theme options as of today, you cannot achieve this without horribly ruining your seo reputation.
I have tried many ways to do this, using tumblr php api and other,
This worked for me: I am using a page outside tumblr and loading the tagged posts via curl php calls.
It can be done via ajax but for SEO reasons I wanted to use php.
Here is the code:
$oath = 'xxx';
$blogName = 'yyy.tumblr.com';
$tag='tagname';
$apiLink = "http://api.tumblr.com/v2/blog/$blogName/posts/?api_key=$oath&tag=$tag";
// Initializing curl
$ch = curl_init( $apiLink );
// Configuring curl options
$options = array(
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => array('Content-type: application/json') ,
);
// Setting curl options
curl_setopt_array( $ch, $options );
// Getting results
$result = curl_exec($ch); // Getting JSON result string
$data = json_decode($result);
$posts = $data->response->posts;
I realise this is old, but I've just had to do it, so here is my solution. At the end of the theme, in the script tags add:
{block:IndexPage}
$( ".the-posts" ).load( "tagged/home .the-posts article" );
{/block:IndexPage}
Where home is the tag you have given the posts you wish to see on the index page. This will basically load the correct articles into the posts div, replacing what it there. See the jquery man page: http://api.jquery.com/load/ for more info.
I'm currently using wordpress 3.5 and creating a page template of my own. I have my own form in that template and when I click the submit button, it is successfully saved the data to my database. Unfortunately, when I click F5 or refresh button on my browser, It prompts an alert which says there will be a double form submission if I continue.
Usually I prevent this by using "redirect to the same page after submitting" technique. But I can't use header("location: ") to redirect because it generates error: Warning: Cannot modify header information - headers already sent by. Probably there are echos on other wordpress file that prevent redirecting.
Does anyone know how to solve this? Or does anybody know other technique to prevent double form submission beside redirecting?
I've always done this with Javascript:
<?php if(isset($_POST['submit_flag'])){ ?>
<script type='text/javascript'>
window.location='URL';
</script>
<?php } ?>
But now that I think about it, you could easily create another PHP page somewhere in your theme that's not included by the rest of your theme to handle the form data and re-direct back to your form.
I'm also about 98% sure that you can include $wpdb without sending headers by simply requiring "wp-blog-header.php".
There is no output besides in your template file. What would that be? Look at the source code of your website, it's only exactly what you tell Wordpress to create.
So that's first: you can use header("Location: ") at the top of the template file that's called on first. Usually header.php.
Secondly, you can (and usually should) use hooks to handle forms. For example:
add_action( 'init', function() {
// Handle stuff
} );
But perhaps with a different hook (I don't recall any best practice). Tutorials here and there will give you suggestions. In this case you will definitely call header("Location: " ) before there is any output. Your theme hasn't even been involved yet.
My application has "survived" many Facebook API changes, to the point where it's quite messy.
Anyway: I'm no longer able to POST a simple HTML form. The entire page reloads and no data is saved.
I've tried several things. Changing the "action" url to include several Facebook parameters, changing the target (canvas_iframe) but to no avail.
Has anyone else encountered problems with this?
try to write absolute path in "action". Its not important include Facebook parameter
Give site url("www.example.com/") as the value of the action attribute rather the Canvas URL(http://appifylabs.com/facebook/yourapp/processform.php)
e.g
if processform.php is the script that will manipulate your form so give the value
site_url = "www.example.com/";
action="<?php echo site_url; ?>processform.php"
my issue might look a strange a little bit.
i'm working on a cakephp website in which i want to integrate facebook comments, like, and share functions. i'm using for that Webtechnick's Facebook plug-in, and i think this far everything is doing great. except one thing.
whene i call comments and like:
<?php $facebook->comments(); ?>
<?php $facebook->like(); ?>
it works and i have my share and like buttons, but when i call
<?php $facebook->share(); ?>
<?php $facebook->comments(); ?>
<?php $facebook->like(); ?>
only the share button is displayed. It's like if the share button hides likes and comments
not sure if this is clear enough, I know it's a strange problem.
If anybody has experienced something similar to this please help, thank you.
You may be better off using the social plugin versions of these three. I'd recomment you start with the HTML5 versions and go from there.
See:
https://developers.facebook.com/docs/reference/plugins/like/ (does both like and send)
https://developers.facebook.com/docs/reference/plugins/comments/