Could someone help with wordpress?

Soldato
Joined
10 Sep 2008
Posts
2,570
Location
Grendon
Looking for a hand in wordpress, i downloaded a free theme to make a quick portfolio site for somone (Just a simple site to display there photography)

on the theme (The main page) there is a flickr "widget" to display random images, but instead of flickr i want it to display random images from the gallery plugin i installed instead (WP Showroom)

Now it does have a random image widget with it, but i carnt for the life of me get it to show on the main page instead of the flickr stuff :(

Anyone that works with wordpress a lot mind taking a look for me?
 
Go to Appearance > Widgets and drag your Random widget to the appropriate side bar.

I hope that works, it's the only thing I can think of. Also, make sure you have a picture in the Gallery as it wont show up until you do.
 
Well while i cross my fingers that somone can help with the above problem i have a CSS question.

First here is the CSS
Code:
#wpsr-breadcrumb { }

#wpsr-albumlist { }
#wpsr-albumlist ul { list-style-position: inside; list-style-type: none; margin: 0; padding: 0; text-indent: 0px; }
#wpsr-albumlist ul li:before { content: none; position:absolute; }
#wpsr-albumlist li { list-style-position: inside; list-style-type: none; margin:20px 0px 0px 0px; border:1px solid #DDDDDD; overflow:hidden; position:relative; }
And this is where it's displayed http://hanamurray.co.uk/?page_id=62

I don't like the way it stretches across the page, is it possible to set it so there are 2 albums on each line?
 
Oh wow that worked perfect :D

http://hanamurray.co.uk/?page_id=62

Don't suppose you also know about the first question about the random image widget on the homepage?

I can give you the cpanel info if you wouldn't mind having a quick look? If it's going to be too much work ill just have to think of something else
 
Made a topic on the wordpress forums and no replys there either (What i put for if its better to understand)

Hi guys, looking for some help for a plugin to finish a website im working on.

Im using the plugin WP Showroom for the websites gallery, this is all set-up and working fine, BUT i would also like to have the "random pictures" part of the plugin to my homepage.

Here is where my problem starts, the theme im using has the sidebar where i can add the random picture widget too, but this does not add it to the homepage, just to the other pages.

ATM there is a flickr image widget (Displays the last 10 photos uploaded) and this code is inserted direct to the homepage code, so i would like to replace this code with the WP Showroom widget.

But how would i go about this? Would it be a PHP include? I really need to get this sorted before i try and work out how to theme the plugin too (lol should be fun) so if anyone could help me out it would be great :)

If anyone would like to take a look at the plugin/wordpress themes the links are below

WP Showroom (The gallery plugin) http://faild.de/wpshowroom/
Wordpress theme http://www.woothemes.com/2009/02/irresistible/

Thanks in advance

And im guessing it because nobody has used this plugin or theme or it's not possible at all?

So does anyone have an ideas of what else i can do/use? Maybe anouther plugin, or even a script i can add to the code that will display the 10 random pics (2 lines of 5) from the folder where all the photos get uploaded.

I don't mind changing plugin from WP Showroom aslong as the gallery part is the same and i can get the random images sorted.

Or maybe someone has a suggestion on what else i can have there instead of random images?
 
Basically the theme you have chosen has a homepage template (several methods to do this) and as such the widgets havnt been applied to the homepage properly, unless there is a homepage widget box. Thats why it only works on the other pages, and potentially only on the archives/blog posts as they by standard are the only ones with sidebars.

Try another theme, or get dirty in the themes code. It should be fairly simple to identify the homepage template and take out the flickr widget.
 
Yeah I've found the flickr widget, the problem I'm having tho is to add the plugin there.

Would it be better for me to add the widget box myself? How would I go about this (don't want to change the widgets on each page so would like to add one just for the home screen)

Not sure if I've explained that right, lol
 
Right i 'think' im going in the right direction.

http://www.hanamurray.co.uk as you can see ive got the random images to show :D (only one pic uploaded just to check

BUT it's messed up that side of the layout as it overlaps the box under it instead of pushing it down further, any ideas? ill include the code for it below

PHP:
<div id="sidebar">
<h3 id="myPhotos" class="replace"><?php _e('My photos. Now you know me.',woothemes); ?></h3>
<?php get_sidebar(); ?>

                        
                
                <h3 id="myLifestream" class="replace"><?php _e('My lifestream. Stay updated with me.',woothemes); ?></h3>
                
                <div class="box1 clearfix">    
                    
                    <?php if (function_exists(lifestream)) lifestream(get_option('woo_home_lifestream')); ?>
                    
                </div>                           
                    </div>                    
                            
            </div><!-- / #sidebar -->     
        
<?php get_footer(); ?>
 
Right well i have managed to get them to stop overlapping by adding the box1 div, but now the image is not inline with the div and also the box1 div is doubled with it being on the widgets too. So going to find the div that is attached to the widgets and remove it.

But what can i do too align it?

Change of code if you want to look

PHP:
            <div id="sidebar">
<h3 id="myPhotos" class="replace"><?php _e('My photos. Now you know me.',woothemes); ?></h3>
                <div class="box1 clearfix">
<?php get_sidebar(); ?>
</div>        
                
                <h3 id="myLifestream" class="replace"><?php _e('My lifestream. Stay updated with me.',woothemes); ?></h3>
                
                <div class="box1 clearfix">    
                    
                    <?php if (function_exists(lifestream)) lifestream(get_option('woo_home_lifestream')); ?>
                    
                </div>                           
                    </div>                    
                            
            </div><!-- / #sidebar -->     
        
<?php get_footer(); ?>
 
HAHA, slowly getting there :D

Next problem is alignment issues, is this just some CSS code i need to add to the random image widget to wack it over a little?

Sorry for the huge spam in posts, it's been a VERY long time since ive played with code and never used wordpress before (i hate it already) altho it might just be a **** theme
 
Yes another post :( after i get this sorted there is just one more thing so please can somone help with this (dont wanna make a new thread for it)

If you look at the site you can see the random image widget is working fine (I uploaded the same pic to test so ignore the fact they are all the same :p)

But im trying to get them to list across instead of just down. I want it to display 4 on the top line and 4 on the bottom.

I had help with css earlyer on to do a simular thing, so i used the same CSS code on the widget

Code:
    <style type="text/css">
        
#wpsr-randompictures1 {
   list-style-position: inside; 
   list-style-type: none; 
   margin:20px 0px 0px 0px; 
   overflow:hidden; 
   position:relative; 
   width: 570px; 
   float: left; 
}
    
    </style>
BUT it still shows them as a list :( Anyone have any ideas?
 
Here is the rest of the code if it will help

PHP:
/**
 * WPsr_Widget_Random_Pic widget class
 */


class WPsr_Widget_Random_Pic extends WP_Widget {

	function WPsr_Widget_Random_Pic() {
		$widget_ops = array('classname' => 'wpsr_widget_random_pic', 'description' => __( ' ' ) );

		$this->alt_option_name = 'wpsr_widget_random_pic';
		$this->WP_Widget('wpsr-random-pic', __(''), $widget_ops);
		if ( is_active_widget(false, false, $this->id_base) )
			add_action( 'wp_head', array(&$this, 'random_pictures_style') );
	}

	function random_pictures_style() { ?>
	<style type="text/css">
		
#wpsr-randompictures1 {
   list-style-position: inside; 
   list-style-type: none;  
   overflow:hidden; 
   position:relative; 
   width: 570px; 
   float: right; 
}
	
	</style>

<?php
	}

	function widget( $args, $instance ) {
		global $wpdb, $current_user;

		extract($args, EXTR_SKIP);
		$title = apply_filters('widget_title', empty($instance['title']) ? __(' ') : $instance['title']);
		if ( !$number = (int) $instance['number'] ) {
			$number = 6;
		}
		if ( $instance['size'] == '' ) {
			$size = '30x30_c';
		}
		else {
			$size = $instance['size'];
		}

		get_currentuserinfo();
		if ($current_user->user_level != '') {
			$level = $current_user->user_level;
		}
		else {
			$level = 0;
		}

		$q = "SELECT p.pid, p.path, p.file, p.comments FROM ".WPSR_DB_P." p LEFT JOIN ".WPSR_DB_R." r ON r.id = p.pid WHERE r.level <= $level ORDER BY RAND() LIMIT $number";
		$q = $wpdb->prepare($q);
		$result = $wpdb->get_results($q);
?>
		<?php echo $before_widget; ?>
			<?php if ( $title ) echo $before_title . $title . $after_title; ?>
			<ul id="wpsr-randompictures"><?php
			if ($result) {
				foreach ($result as $pic) {
					if ($pic->comments == 0) {
						$comcount = "no";
						$class = "";
					}
					else {
						if ($pic->comments > 1) {
							$class = " wpsr-wcomments";
						}
						else {
							$class = " wpsr-wcomment";
						}
						$comcount = $pic->comments;
					}
					echo '<li>';
					echo '<a href="'.WPsr_getURInoObj(null, $pic->pid, 'picture', '#WPshowroom').'" title="'.$comcount.' comments"><img src="'.WPSR_PATH.$size.'/'.$pic->path.$pic->file.'" /></a>';
/*
					if ($comcount != "no") {
						echo '<div class="wpsr-randompictures'.$class.'">&nbsp;</div>';
					}
*/
					echo '</li>';
				}
			}
			?></ul>
		<?php echo $after_widget; ?>
<?php
	}

	function update( $new_instance, $old_instance ) {
		$instance = $old_instance;
		$instance['title'] = strip_tags($new_instance['title']);
		$instance['number'] = (int) $new_instance['number'];
		$instance['size'] = strip_tags($new_instance['size']);

		$alloptions = wp_cache_get( 'alloptions', 'options' );
		if ( isset($alloptions['wpsr_widget_random_pic']) )
			delete_option('wpsr_widget_random_pic');

		return $instance;
	}

	function form( $instance ) {
		$title = isset($instance['title']) ? esc_attr($instance['title']) : '';
		$number = isset($instance['number']) ? absint($instance['number']) : 6;
		$size = isset($instance['size']) ? esc_attr($instance['size']) : '30x30_c';
?>
		<p><label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:'); ?></label>
		<input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo $title; ?>" /></p>

		<p><label for="<?php echo $this->get_field_id('number'); ?>"><?php _e('Number of pictures to show:'); ?></label>
		<input id="<?php echo $this->get_field_id('number'); ?>" name="<?php echo $this->get_field_name('number'); ?>" type="text" value="<?php echo $number; ?>" size="3" /><br /></p>
		
		<p><label for="<?php echo $this->get_field_id('size'); ?>"><?php _e('Size of thumbnails:'); ?></label>
		<input id="<?php echo $this->get_field_id('size'); ?>" name="<?php echo $this->get_field_name('size'); ?>" type="text" value="<?php echo $size; ?>" /><br /></p>
<?php
	}
}
add_action('widgets_init', create_function('', 'return register_widget("WPsr_Widget_Random_Pic");'));
 
Back
Top Bottom