gastonius
Forum Replies Created
-
Also:
“For example, I have selected to show 6 posts in post but I want there to be only 3 in sidebar.”
Casually, I replied to another guy the solution for that a few months ago:
(I guess I should create a B version of this plugin with all those hacks, as the original owner abandoned it)
Basically: the copy of the plugin is complaining there are more than 1 thing with the same name -which is expected, as we just copied the same thing :)-
This is the nasty / ugly / hacky / do-it-but-don’t-tell-anyone-shame-on-your-code solution:
I’m up to my neck of work right now, but if you can wait for a week or so, I can build a nicer version that would allow you to have more than 1 widget (instead of copying the plugin several times)
Have a nice weekend!
GHi, not my plugin. But I can try to help you, can you paste lines #803~805? (and the error you get), that would be helpful.
Hey, a little late, but as I needed the same today, I modified the plugin a bit and will probably serve for someone in the future:
Edit related-posts-thumbnails.php file
Search for global $wpdb; (around line #90), and before that line add:
if (!empty($this->options)) { foreach ($this->options as $option => $value) { $$option = $value; } }
Then, search for function get_related_posts_thumbnails() (around line 830) and modify it to look like this:
function get_related_posts_thumbnails( $options = false )
And two lines below (right after global $related_posts_thumbnails;), add this:
if (!empty($options)) { $related_posts_thumbnails->options = $options; }
And that’s it!
Now, you can overwrite any admin option on the call:
Want to show 5 related posts?
<?php get_related_posts_thumbnails(array('posts_number' => 5 )); ?>
Again, I can send diff files to the developer or anyone who ask for them.
Have a great day!
Gaston GorosterrazuHi lackie, using your fav text editor, just search for “relpoststh_” (without the quotes) and replace for “relpoststhb_” or something similar in your new copy, that should do.
Have a great day
Well, as it says, it’s experimental at most… this code works with RADIO, after a quick look at the code I guess it works with SELECT but wont work with CHECKBOX.
$valueLabel is the variable to use (same way: as array)
$args = array('type' => 'post','child_of' => 0,'parent' => '', 'orderby' => 'name', 'order' => 'ASC', 'hide_empty'=> 0,'hierarchical'=> 1,'exclude'=> '','include'=> '','number'=> '','taxonomy'=> 'category','pad_counts'=> false ); $categories = get_categories( $args ); $outValues = Array(); $outLabels = Array(); foreach($categories as $category) { $outLabels[] = $category->name; $outValues[] = $category->slug; } $valueLabel = $outLabels; $values = $outValues;
In theory, you should be able to rewrite any of these variables, and this is probably well documented in Author’s web site, sadly to me: it’s full of funny looking symbols ??
$cftnum = $values = $valueLabels = $default = $hideKey = $label = $code = $class = $style = $before = $after = $selectLabel = $multipleButton = $onclick = $ondblclick = $onkeydown = $onkeypress = $onkeyup = $onmousedown = $onmouseup = $onmouseover = $onmouseout = $onmousemove = $onfocus = $onblur = $onchange = $onselect = '';
Have fun,
Gaston Gorosterrazu