hey everyone
wasn't sure if this was an html or php issue. i'm working on a wordpress site ( http://subt.net/wordpress) and having trouble figuring out how to indent the 2nd line of wrapped text w/in a .php widget. see full widget php code below.
on the subt.net/wordpress site, if you look under the 'up and coming shows' left sidebar widget, there's a show titled 'eli paperboy reed & the true loves'.. many of the show entries are only 1-lined, but in some cases it spills on the 2nd line. in those cases, i'd like the 2nd to indent so it lines up with the artist name instead of the show date.
i've tried adding nbsp's to the show's title. it's a quick fix and displays perfectly inside the widget, but the nbsp's are shown on other pages where the show title appears.
is there anyway format this w/in php? i'm a php newbie btw, any help is greatly appreciated! -
<?php
-
-
//Sidebar Widget file
-
-
-
class ListCategoryPostsWidget extends WP_Widget{
-
-
function ListCategoryPostsWidget() {
-
parent::WP_Widget(false, $name = 'ListCategoryPostsWidget');
-
}
-
-
function widget($args, $instance) {
-
extract( $args );
-
$title = apply_filters('widget_title', $instance['title']);
-
$limit = (is_numeric($instance['limit'])) ? $instance['limit'] : 5;
-
$orderby = ($instance['orderby']) ? $instance['orderby'] : 'date';
-
$order = ($instance['order']) ? $instance['order'] : 'desc';
-
$exclude = ($instance['exclude'] != '') ? $instance['exclude'] : 0;
-
$excludeposts = ($instance['excludeposts'] != '') ? $instance['excludeposts'] : 0;
-
$offset = (is_numeric($instance['offset'])) ? $instance['offset'] : 0;
-
$category_id = $instance['categoryid'];
-
$dateformat = ($instance['dateformat']) ? $instance['dateformat'] : get_option('date_format');
-
$showdate = ($instance['show_date'] == 'on') ? 'yes' : 'no';
-
$showexcerpt = ($instance['show_excerpt'] == 'on') ? 'yes' : 'no';
-
$showauthor = ($instance['show_author'] == 'on') ? 'yes' : 'no';
-
$showcatlink = ($instance['show_catlink'] == 'on') ? 'yes' : 'no';
-
-
echo $before_widget;
-
echo $before_title . $title . $after_title;
-
$atts = array(
-
'id' => $category_id,
-
'orderby' => $orderby,
-
'order' => $order,
-
'numberposts' => $limit,
-
'date' => $showdate,
-
'author' => $showauthor,
-
'dateformat' => $dateformat,
-
'template' => 'default',
-
'excerpt' => $showexcerpt,
-
'exclude' => $exclude,
-
'excludeposts' => $excludeposts,
-
'offset' => $offset,
-
//'tags' => '',
-
//'content' => 'no',
-
'catlink' => $showcatlink
-
);
-
-
echo list_category_posts($atts);
-
echo $lcp_result;
-
echo $after_widget;
-
}
-
-
/** @see WP_Widget::update */
-
function update($new_instance, $old_instance) {
-
return $new_instance;
-
}
-
-
/** @see WP_Widget::form */
-
function form($instance) {
-
include('lcp_widget_form.php');
-
}
-
}
-
add_action('widgets_init', create_function('', 'return register_widget("listCategoryPostsWidget");'));
-
-
?>
-
1 2184
The easiest way to deal with this is to have 2 paragraphs, 2 divs, or a table with 2 columns. One for the date and the other for the content. That way, the content will always be left aligned without having to worry about fancy alignment methods. It's darn near impossible anyway given most font metrics.
Using a table: -
<table><tr><td><a href="http://subt.net/wordpress/?p=481">03/23</a></td><td><a href="http://subt.net/wordpress/?p=481">Eli Paperboy Reed & The True Loves (17+)</a></td></tr></table>
-
You'd have to work out the vertical alignment.
Obviously with the <p> and <div> elements you'll need some additional css.
I don't remember if using a table is semantically correct, but since it's a block-level element, I believe it is.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Jonathan |
last post by:
I have a specific situation where I am applying padding to text inside of a
"P" tag, where if the text wraps then the second line of text ignores the
padding. Here is a snippet of what I am doing:...
|
by: sweep |
last post by:
Hi there,
I have a problem with some CSS I'm writing and I was looking for a little
help. I have a nav bar at the top and left side of my page in CSS which work
fine. The remaining space has a...
|
by: Ronny Sigo |
last post by:
Hello all,
Could anybody give me the correct syntax to set the :
line indent,
top margin
cursor position
in Ms Word, with VBA ?
Thanks !!!
Ronny Sigo
....
Here's what I have done so far,...
|
by: carl.barrett |
last post by:
Hi,
Let me explain. I have been given a file that I need to bring into an
Access table.
Here is a snippet of the file.
100833983
1 MRS M I BATTY
1 000001 00833983
|
by: Joaquim Pinto |
last post by:
Hi All,
I'm using a richtextbox to find a particular string on a text file.
Each line has more then one string separated by comas, like this:
11-11-2004, 08:30:00, 02:56:00, 04:00
I want...
|
by: Sam Martin |
last post by:
Hi all,
I want to be able to draw wrapped text started at a point x into the
rectangle on the first line
If there's not a GDI+ method for this, i'm guessing it's a common technique,
but can't...
|
by: Adrian Lin |
last post by:
Is there a way to read a specfic line in a text file? For instance if I
wanted to just read the 5th line is that possible without having to step
through the other lines? Essentially I am doing huge...
|
by: John Salerno |
last post by:
This is a real small point, but I'd like to hear what others do in this
case. It's more an 'administrative' type question than Python code
question, but it still involves a bit of syntax.
One...
|
by: youngjin.michael |
last post by:
Hello,
I am new to Python and have one simple question to which I cannot find
a satisfactory solution.
I want to read text line-by-line from a text file, but want to ignore
only the first line....
|
by: astroumut |
last post by:
Hi,
I need a help regarding reading a line in a text file. I have some files with columns but some header information at the top. Some of these header lines begin with a *, and some of them with...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
| |