CSS help please

Crabby

Honorary Master
Joined
Jun 30, 2005
Messages
11,040
Reaction score
198
Location
CT
Hi all

Beginner Wordpress user here. I am using a free WP theme that I love but for one thing, the text on the slider image.

Here is a snippet of the code.

Basically, I want to remove the banner text completely, and force the image itself to be a link, instead of the post title that gets ID'd.

So I need the url in the code to attach to the image code and then do away with the banner-text.site-container completely.

Is there anyone that can assist in this ?

Code:
<div class="site-banner-carousel" id="site-banner-carousel">
	<?php  
	$wrt_slider_counter=0;
	
	while($wrt_slider_data->have_posts()): 
	$wrt_slider_data->the_post(); 
	if(has_post_thumbnail()) : 
	$src =  wp_get_attachment_image_src(get_post_thumbnail_id( get_the_ID()), 'WRT-slider');
	
	$wrt_slider_counter++;
	
	?>
	<div class="banner-item">
		[COLOR="#FF0000"]<div class="banner-media" style="<?php echo 'background-image:url('. $src[0].')'; ?>">[/COLOR]
		</div>
		
		[COLOR="#008000"]<div class="banner-text">
			<div class="site-container">[/COLOR]
				<?php if($slider_meta_status == 'enable'): ?>
					<span class="banner-text-cat"><?php the_category(',') ?></span>
				<?php endif; ?>
				
				[COLOR="#FFA500"]<?php the_title( '<h2 class="banner-text-title"><a href="' . esc_url( get_permalink() ) . '">', '</a></h2>' ) ?>[/COLOR]
				<?php if($slider_meta_status == 'enable'): ?>
					<span class="banner-text-author"><?php echo __('By', 'writee') ?> <?php the_author_posts_link() ?></span>
				<?php endif; ?>
				
			</div>
		</div>
	</div>
	
	<?php endif; endwhile;	?>
</div>
 
You can try this, but make a backup first :)


Code:
<div class="site-banner-carousel" id="site-banner-carousel">
	<?php  
	$wrt_slider_counter=0;
	
	while($wrt_slider_data->have_posts()): 
	$wrt_slider_data->the_post(); 
	if(has_post_thumbnail()) : 
	$src =  wp_get_attachment_image_src(get_post_thumbnail_id( get_the_ID()), 'WRT-slider');
	
	$wrt_slider_counter++;
	
	?>
	<div class="banner-item">
		<a href="' . esc_url( get_permalink() ) . '"><div class="banner-media" style="<?php echo 'background-image:url('. $src[0].')'; ?>">
		</div></a>
		
		
	</div>
	
	<?php endif; endwhile;	?>
</div>
 
I haven't worked on WordPress for a while (and I'm not a web designer), but when I did I realised the 'free' templates are a pain to edit without addons. Don't think they always want you to edit some of the code.
I just started with a blank theme and added the code mixed with addons until it looked similar to the theme I liked.

There are addons you can use to hide the container.
You can then add a slider image via another addon and customize it.
 
Last edited:
Top
Sign up to the MyBroadband newsletter
X