- This topic is empty.
-
AuthorPosts
-
August 2, 2014 at 10:49 am #177309
jlbrown1
ParticipantHello folks! :-)
If you go to http://www.saddlebackstables.net/boarding/ and inspect the middle progress bar that says “Pasture”, you will see the following:
20%
The progress bar is reflecting the correct level, but the 20% should be showing in the bar also.
You can see what it should look like here:
http://wptest.saddlebackstables.net/?page_id=312
Thanks in advance!
Jason
August 2, 2014 at 11:12 am #177312Senff
ParticipantThe words “Pasture” and “20%” don’t fit in the small space that’s available (about 33 px), so the “20%” wraps to the next line. Only when it’s about 65% is when you’ll see it, that’s when there’s enough room to show them both.
August 2, 2014 at 11:19 am #177314Paulie_D
MemberI think the width of the div is restricting the content…is the overflow hidden somehow?
if you take the two spans out of the progress-bar div and place them the text shows up…it might be in the wrong place, but it’s visible.
<div class="progress active"> <div class="progress-bar progress-bar-default" style="width: 20%"> </div><span class="pull-left"> Pasture</span> <span class="pull-right">20% </span> </div>
Looks to me as though it’s the width that’s the issue.
August 2, 2014 at 11:57 am #177319jlbrown1
ParticipantAugust 2, 2014 at 12:08 pm #177322Senff
Participant@jlbrown1 to make it show all the time, you’ll have to move things around, and take the text (and percentage) out of the actual progress bar, pretty much like Paulie suggests.
In essence, don’t make the available space for the text depend on the value of the progress bar.
August 2, 2014 at 12:08 pm #177323jlbrown1
ParticipantPage
[column size=”1/4″ margin=”” last=”no”]
<h5 class=”special-title”>Occupancy Level</h5>
[progress color=”#27ae60″ percent=”0″]Stall[/progress][progress color=”#27ae60″ percent=”20″]Pasture[/progress]
[progress color=”#27ae60″ percent=”0″]Overnight[/progress]
[/column]
Shortcode
<?php
add_shortcode(“progress”, “curly_progress”);function curly_progress( $atts, $content = null ) {
extract(shortcode_atts(array(
“color” => ‘default’,
‘percent’ => null
), $atts));$css = null;
switch ($color){
case ‘red’ : $css = ‘ progress-bar-danger’;break;
case ‘blue’ : $css = ‘ progress-bar-info’;break;
case ‘green’ : $css = ‘ progress-bar-success’;break;
case ‘orange’ : $css = ‘ progress-bar-warning’;break;
default : $css = ‘ progress-bar-default’;
}return ‘
‘.$content.’‘.$percent.’%‘;
}
August 2, 2014 at 12:17 pm #177325jlbrown1
ParticipantAugust 2, 2014 at 12:21 pm #177326Paulie_D
MemberThere’s several ways to do this but certainly the spans could go back in the progess div.
However, that should always be 100% wide. So you affect the background color somehow.
An extra div (absolutely positioned underneath perhaps) or a pseudo element…or a linear gradient background…many many ways.
August 2, 2014 at 12:36 pm #177328jlbrown1
ParticipantI am a noob…best practice or easiest acceptable way? Spoon feed me…if you don’t mind. ;-) I am trying…
August 2, 2014 at 1:59 pm #177339Paulie_D
MemberIs the width dynamic or are you setting it manually?
August 2, 2014 at 2:08 pm #177340jlbrown1
ParticipantNo clue…remember…noob… :-)))
How do I figure that out…I gave you the shortcode on the page and the shortcode definition…what else do we need?
August 3, 2014 at 1:56 am #177381Paulie_D
MemberI don’t grok ‘shortcodes’…whatever they are.
Is this a PHP/WP thing?
August 3, 2014 at 10:18 am #177422jlbrown1
ParticipantI don’t even know what ‘grok’ means… :-)
Yes, a shortcode is PHP/WP thing. It allows you to easily perform functions if you are non-technical. So a developer will write a shortcode as a part of their WP theme or Plugin and then the end user like me will just type in the shortcode and values that correspond to its acceptable arguments.
So in this case:
[progress color=”#27ae60″ percent=”20″]Pasture[/progress]
So [progress] is the shortcode and above the color and percent are the arguments and the word Pasture is the text obviously.
Above I pasted the PHP code that explains what is happening when I call the [progress] shortcode because I thought it might answer the question you asked regarding the width being dynamic or manual. I don’t know…I simply used the shortcode. My assumption is that since I don’t see anything regarding width in the PHP code, it must be part of the “responsive” theme in WordPress. I noticed on my 7″ tablet this morning that if I turn it landscape, I do see the text (like @Senff stated). So it is working…I would just like to see it all the time, but I can live with it this way.
Thanks!
:-)
-
AuthorPosts
- The forum ‘CSS’ is closed to new topics and replies.