Welcome! To use this support forum, please Login or Join Today!

   

Floating a note box?

{name}
RankRank

Total Posts: 43

Joined 2011-05-19

PM

 
Hi
Is there any neat way of making a note box float to the right of a page? At the top of this page I want to float the special offer box across to the right and flow the article round it.

I don't want to mess too much with the content because this page does really well in Google for me.

If need be I'll define a new class for it but if there's something in the theme I haven't used yet I'd rather do that. Any good ideas?

thanks
Nick

Oops - sorry wrong theme. Should be Impacto
{name}
RankRankRankRank

Total Posts: 3667

Joined 2011-04-27

PM

 
You can, with some modifications to the shortcode in content_funtions.php and a little CSS addition.
First, modify the shortcode around line# 705 to:

// Alerts
function note_shortcode( $atts, $content = null ) {
extract( shortcode_atts( array(
'class' => '',
'align' => 'center',
'width' => ''
), $atts ) );
if (isset($width)) $style = 'style="width:' . esc_attr($width) . 'px;" ';
return '<div class="note ' . esc_attr($class) . ' ' . esc_attr($align) . '" '.$style.'>' . $content . '</div>';
}
add_shortcode('note', 'note_shortcode');
This will give you some additional parameters (align and width) however if you pass an align parameter such as left or right, you must supply a width.
[note class="alert" align="right" width="100"]this is my note text[/note]

Then, just add this CSS right above div.note in master.css:

.note.right {
float: right;
display: inline-block;
}

.note.left {
float: left;
display: inline-block;
}

.note.center {
float: none;
clear: both;
}
{name}
RankRank

Total Posts: 43

Joined 2011-05-19

PM

 
Wow, thanks Casey. That's saved me a good hour or two.

How well do the themes play with child themes? I've done the usual simple template mods in a child theme before, but not on a theme like Impacto. Are any of the functions declared conditionally? Can I avoid having to modify theme files?

thanks again
NIck
{name}
RankRankRankRank

Total Posts: 3667

Joined 2011-04-27

PM

 
I haven't tried the child theme approach but if you copy over and modify the layout files (in root) I don't see any reason why the backend and core functions wouldn't continue to work as expected.

The framework I've built is not the traditional WP theme framework, because I feel it passes on unnecessary bloat and unused code to the user - plus I don't like being locked in to one box model in every theme. I could probably go through and standardize a few functions into hooks, but maybe at a later time.