jjsoini
Forum Replies Created
-
Forum: Themes and Templates
In reply to: Twenty Ten too complex for learning theme design“The Loop” is basically the template for each post. That part of the code loops through all the posts that were fetched from the database and applies the template to each.
The old default theme contained 8 lines of code inside the loop of index.php, outputting a DIV box, a post title, time and author, the post content and a row of meta links (comments, edit).
Twenty Ten’s custom loop for the index page contains over 100 lines of code that customize the post depending of some custom categories in which the post belongs to (galleries, etc). It also uses theme’s custom functions defined in functions.php instead of WordPress Template Tags, so you can’t even explain them using the WordPress Documentation.
Forum: Themes and Templates
In reply to: WordPress puts <p> around <img />, how do you disable this?To automatically wrap the image in <div>s instead of <p>, add a caption to the image.
By adding a caption, WordPress autogenerates a div-wrapper (
.wp-caption) around the image with desired alignment class (.alignleft, .alignright, etc).Now you can style the images separately without paragraph styles affecting them.
If you don’t want to show a caption for your images, you can insert a single space for caption, and/or use CSS to hide the caption with
.wp-caption-text {display: none}.This is useful if the end-users (ie. your clients) are not comfortable with the code editor.