WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Sidebar/CSS/TripleK2 (6 posts)

  1. Napoleon
    Member
    Posted 5 years ago #

    Hey my friends,

    I set up a new blog, usink Triple2k theme and WP 2.6, at http://www.almerood.de/berlin/ (is kinda slow, please be patient) and I have a problem.

    I tried placing a background-url into the .secondary h2 class, but then the blue background is just as long as the text. The position is wrong as well. I just want to have the same lines as at the left sidebar which are positioned by easy HTML code.

    We made it that the headers are blue but were not able to change width or position.

    Any suggestions?

    Thanks in advance!
    Best
    Napo

  2. fp.darren
    Member
    Posted 5 years ago #

    <img height="10" width="150" alt="" src="http://www.almerood.de/berlin/wp-content/themes/triplek2-091/images/line.gif"/>

    after the <div class="secondary">

    or before the widget... so you could have a blue line like the left sidebar...

  3. Napoleon
    Member
    Posted 5 years ago #

    Hey darren,

    Thank you for your fast replay. However, I can add this line with the code you mentioned. Unfortunately, the rest is in "widgets" so I can't put it in that easily. Any suggestions for the rest?

    Attached the sidebar.php:

    <?php
    	$k2asidescategory = get_option('k2asidescategory');
    ?>
    <hr />
    <div class="secondary">
        <img src="http://www.almerood.de/berlin/wp-content/themes/triplek2-091/images/line.gif" alt="" width="250" height="10" />
        <img src="http://www.almerood.de/berlin/wp-content/themes/triplek2-091/images/spacer.gif" width="250" height="10" />
    <?php /* WordPress Widget Support */ if (function_exists('dynamic_sidebar') and dynamic_sidebar(1)) { } else { ?>
    	<div id="search"><h2><?php _e('Search','k2_domain'); ?></h2>
    		<?php include (TEMPLATEPATH . '/searchform.php'); ?>
    	</div>
    	<?php /* Menu for subpages of current page */
    		global $notfound;
    		if (is_page() and ($notfound != '1')) {
    			$current_page = $post->ID;
    			while($current_page) {
    				$page_query = $wpdb->get_row("SELECT ID, post_title, post_status, post_parent FROM $wpdb->posts WHERE ID = '$current_page'");
    				$current_page = $page_query->post_parent;
    			}
    			$parent_id = $page_query->ID;
    			$parent_title = $page_query->post_title;
    
    			if ($wpdb->get_results("SELECT * FROM $wpdb->posts WHERE post_parent = '$parent_id' AND post_status != 'attachment'")) {
    	?>
    
    	<div class="sb-pagemenu">
    		<h2><?php echo $parent_title; ?> <?php _e('Subpages','k2_domain'); ?></h2>
    
    		<ul>
    			<?php wp_list_pages('sort_column=menu_order&title_li=&child_of='. $parent_id); ?>
    		</ul>
    
    		<?php if ($parent_id != $post->ID) { ?>
    			<a href="<?php echo get_permalink($parent_id); ?>"><?php printf(__('Back to %s','k2_domain'), $parent_title ) ?></a>
    		<?php } ?>
    	</div>
    	<?php } } ?>
    
    	<?php if (is_attachment()) { ?>
    		<div class="sb-pagemenu">
    			<a href="<?php echo get_permalink($post->post_parent); ?>" rev="attachment"><?php printf(__('Back to \'%s\'','k2_domain'), get_the_title($post->post_parent) ) ?></a>
    		</div>
    	<?php } ?>
    
    	<?php /* If there is a custom about message, use it on the frontpage. */ $k2about = get_option('k2aboutblurp'); if ((is_home() and $k2about != '') or !is_home() and !is_page() and !is_single() or is_paged()) { ?>
    
    	<div class="sb-about">
    		<h2><?php _e('About','k2_domain'); ?></h2>
    
    		<?php /* Frontpage */ if (is_home() and !is_paged()) { ?>
    		<p><?php echo stripslashes($k2about); ?></p>
    
    		<?php /* Category Archive */ } elseif (is_category()) { ?>
    		<p><?php printf(__('You are currently browsing the %1$s weblog archives for the %2$s category.','k2_domain'), '<a href="' . get_settings('siteurl') .'">' . get_bloginfo('name') . '</a>', single_cat_title('', false) ) ?></p>
    
    		<?php /* Day Archive */ } elseif (is_day()) { ?>
    		<p><?php printf(__('You are currently browsing the %1$s weblog archives for the day %2$s.','k2_domain'), '<a href="' . get_settings('siteurl') .'">' . get_bloginfo('name') . '</a>', get_the_time(__('l, F jS, Y','k2_domain'))) ?></p>
    
    		<?php /* Monthly Archive */ } elseif (is_month()) { ?>
    		<p><?php printf(__('You are currently browsing the %1$s weblog archives for the month %2$s.','k2_domain'), '<a href="'.get_settings('siteurl').'">'.get_bloginfo('name').'</a>', get_the_time(__('F, Y','k2_domain'))) ?></p>
    
    		<?php /* Yearly Archive */ } elseif (is_year()) { ?>
    		<p><?php printf(__('You are currently browsing the %1$s weblog archives for the year %2$s.','k2_domain'), '<a href="'.get_settings('siteurl').'">'.get_bloginfo('name').'</a>', get_the_time('Y')) ?></p>
    
    		<?php /* Search */ } elseif (is_search()) { ?>
    		<p><?php printf(__('You have searched the %1$s weblog archives for \'<strong>%2$s</strong>\'.','k2_domain'),'<a href="'.get_settings('siteurl').'">'.get_bloginfo('name').'</a>', wp_specialchars($s)) ?></p>
    
    		<?php /* Author Archive */ } elseif (is_author()) { ?>
    		<p><?php printf(__('Archive for <strong>%s</strong>.','k2_domain'), get_the_author()) ?></p>
    		<p><?php the_author_description(); ?></p>
    
    		<?php } elseif (function_exists('is_tag') and is_tag()) { ?>
    		<p><?php printf(__('You are currently browsing the %1$s weblog archives for \'%2$s\' tag.','k2_domain'), '<a href="'.get_settings('siteurl').'">'.get_bloginfo('name').'</a>', get_query_var('tag') ) ?></p>
    
    		<?php /* Paged Archive */ } elseif (is_paged()) { ?>
    		<p><?php printf(__('You are currently browsing the %s weblog archives.','k2_domain'), '<a href="'.get_settings('siteurl').'">'.get_bloginfo('name').'</a>') ?></p>
    
    		<?php /* Permalink */ } elseif (is_single()) { ?>
    		<p><?php next_post('%', __('Next: ','k2_domain'),'yes') ?><br />
    		<?php previous_post('%', __('Previous: ','k2_domain') ,'yes') ?></p>
    
    		<?php } ?>
    
    		<?php if (!is_home() and !is_paged() and !in_category($k2asidescategory) or is_day() or is_month() or is_year() or is_author() or is_search() or (function_exists('is_tag') and is_tag())) { ?>
    			<p><?php _e('Longer entries are truncated. Click the headline of an entry to read it in its entirety.','k2_domain'); ?></p>
    		<?php } ?>
    	</div>
    
    	<?php } ?>
    
    	<?php /* Brian's Latest Comments */ if ((function_exists('blc_latest_comments')) and is_home()) { ?>
    	<div class="sb-comments sb-comments-blc">
        	<h2><?php _e('Comments','k2_domain'); ?></h2>
    
    		<a href="<?php bloginfo('comments_rss2_url'); ?>" title="<?php _e('RSS Feed for all Comments','k2_domain'); ?>" class="feedlink"><img src="<?php bloginfo('template_directory'); ?>/images/feed.png" alt="RSS" /></a>
    		<ul>
    			<?php blc_latest_comments('5','3','false'); ?>
    		</ul>
    	</div>
    	<?php } ?>
    
    	<?php /* Show Asides only on the frontpage */ if (!is_paged() and is_home() and (get_option('k2asidesposition') != '0') and ($k2asidescategory != '0') ) { ?>
    	<div class="sb-asides">
    		<h2><?php echo get_the_category_by_ID($k2asidescategory); ?></h2>
    		<span class="metalink"><a href="<?php bloginfo('url'); ?>/?feed=rss&amp;cat=<?php echo $k2asidescategory; ?>" title="<?php _e('RSS Feed for Asides','k2_domain'); ?>" class="feedlink"><img src="<?php bloginfo('template_directory'); ?>/images/feed.png" alt="RSS" /></a></span>
    		<div>
    		<?php
    			/* Choose a category to be an 'aside' in the K2 options panel */
    			$temp_query = $wp_query;
    			$asides_count = 1;
    			query_posts('cat='.$k2asidescategory."&showposts=".get_option('k2asidesnumber'));
    			while (have_posts()) { the_post();
    		?>
    			<div id="post-<?php the_ID(); ?>" class="<?php k2_post_class($asides_count++, true); ?>">
    				<span>&raquo;&nbsp;</span><?php the_content(__('(more)','k2_domain')); ?>&nbsp;<span class="metalink"><a href="<?php the_permalink(); ?>" rel="bookmark" title='<?php _e('Permanent Link to this aside','k2_domain'); ?>'>#</a></span>&nbsp;<span class="metalink"><?php comments_popup_link('0', '1', '%', '', ' '); ?></span><?php edit_post_link(__('edit','k2_domain'),'&nbsp;&nbsp;<span class="metalink">','</span>'); ?>
    			</div>
    			<?php /* End Asides Loop */ } $wp_query = $temp_query; ?>
    		</div>
    	</div>
    	<?php } ?>
    
    	<?php /* Latest Entries */ if ( (is_home()) or (is_search() or (is_404()) or ($notfound == '1')) or (function_exists('is_tag') and is_tag()) or ( (is_archive()) and (!is_author()) ) ) { ?>
    	<div class="sb-latest">
    		<h2><?php _e('Latest','k2_domain'); ?></h2>
    		<span class="metalink"><a href="<?php bloginfo('rss2_url'); ?>" title="<?php _e('RSS Feed for Blog Entries','k2_domain'); ?>" class="feedlink"><img src="<?php bloginfo('template_directory'); ?>/images/feed.png" alt="RSS" /></a></span>
    
    		<ul>
    			<?php wp_get_archives('type=postbypost&limit=10'); ?>
    		</ul>
    	</div>
    	<?php } ?>
    
    	<?php /* FlickrRSS Plugin */ if ((function_exists('get_flickrRSS')) and is_home() and !(is_paged())) { ?>
    	<div class="sb-flickr">
    		<h2>Flickr</h2>
    		<span class="metalink"><a href="http://flickr.com/services/feeds/photos_public.gne?id=<?php echo get_option('flickrRSS_flickrid'); ?>&amp;format=rss_200" title="<?php _e('RSS Feed for flickr','k2_domain'); ?>" class="feedlink"><img src="<?php bloginfo('template_directory'); ?>/images/feed.png" alt="RSS" /></a></span>
    
    		<div>
    			<?php get_flickrRSS(); ?>
    		</div>
    	</div>
    	<?php } ?>
    
    	<?php /* if ((function_exists('feedlist')) and is_home() and !(is_paged()) ) { ?>
    	<div class="sb-feedlist"><h2><?php _e('Feedlist','k2_domain'); ?></h2>
    		<ul>
    			<?php feedList(array("rss_feed_url"=>"",
    				"num_items"=>10,
    				"show_description"=>false,
    				"random"=>true,
    				"sort"=>"asc","new_window"=>true));
    			?>
    			</ul>
    	</div>
    	<?php } */ ?>
    
    	<?php /* Links */ if ( (is_home()) and !(is_page()) and !(is_single()) and !(is_search()) and !(is_archive()) and !(is_author()) and !(is_category()) and !(is_paged()) ) { $links_list_exist = @$wpdb->get_var("SELECT link_id FROM $wpdb->links LIMIT 1"); if($links_list_exist) { ?>
    	<div class="sb-links">
    		<ul>
    			<?php get_links_list(); ?>
    		</ul>
    	</div>
    	<?php } } ?>
    
    	<?php /* Related Posts Plugin */ if ((function_exists('related_posts')) and is_single() and ($notfound != '1')) { ?>
    	<div class="sb-related">
    		<h2><?php _e('Related Entries','k2_domain'); ?></h2>
    
    		<ul>
    			<?php related_posts(10, 0, '<li>', '</li>', '', '', false, false); ?>
    		</ul>
    	</div>
    	<?php } ?>
    
    	<?php /* Include users sidebar additions */ if ( file_exists(TEMPLATEPATH . '/shoutbox.php') ) { include(TEMPLATEPATH . '/shoutbox.php'); } ?>
    
    <?php } ?>
    
    </div>
    <div class="clear"></div>
  4. Napoleon
    Member
    Posted 5 years ago #

    Anyone? I can't put the lines above the other Headlines (.secondary h2) - need help :)

  5. fp.darren
    Member
    Posted 5 years ago #

    you already had the blue lines ... hmm... what do you mean other headlines?

  6. Napoleon
    Member
    Posted 5 years ago #

    Solved by editing functions.php with the following code:

    // Sidebar registration for dynamic sidebars
    if(function_exists('register_sidebar')) {
    	register_sidebar(array('before_widget' => '<div id="%1$s" class="widget %2$s">',
    	                       'after_widget'  => '</div>',
    			       'before_title'  => '<img src="http://www.yoururl.com/spacer.gif" width="20" height="1" />
    				                   <img src="http://wwww.yoururl.com/line.gif" alt="" width="250" height="10" />
    				                   <img src="http://www.yoururl.com/spacer.gif" width="20" height="10" />
    						   <h2 class="widgettitle">'));
    }

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.