Reputation: 3
all i ever wanted is having one single cover photo for each of my post instead of the photoset. I was able to disable the photoset thanks to a topic in this forum How to disable the photoset in tumblr theme
the problem now is:
1) the photoset is disabled also in the post permalink page. I wanted to disable it only for my homepage. 2) the pictures on my homepage are not linkable anymore, so i can't acces to my post permalink.
my site is www.thewhaleside.tumblr.com i use a normal Optical Grid Theme
i hope somebody can help me with this :(
Upvotes: 0
Views: 769
Reputation: 3265
OK this is how I would do it. Most themes have jquery installed, you need to make sure yours does. In fact it does I just checked.
I would create two variables like this inside an iframe load function (as tumblr embeds photosets in iframes by default):
$('iframe.photoset').load(function(){
$path = window.location.pathname;
$primaryDir = $path.split("/")[1];
if(($primaryDir == 'page') || (!$primaryDir)){
$iframe = $('iframe.photoset').contents();
$iframe.find('.photoset_row:gt(0)').remove();
}
});
The variable $path just returns the current url, $primaryDir splits the url at the leading / and gets the first index (page, about, tagged, etc)
Then we need an if statement to test the variables. If the primary directory is nothing, or 'page' then run this function.
Now the next bit might be a bit tricky for me to get the right selector. We need to find the photoset element and remove any image that is not the first one, this is embedded in an iframe, so we need this to run outside of the document ready function.
I think that will work, but it will need some testing and tweaking.
(I've made loads of edits to this so apologies if it is not clear.
Upvotes: 0