heatherland
Member
Posted 8 months ago #
Hi!
I'm new both to WordPress and PHP, so could really use a helping hand on this one. I'm using images (logos) instead of text on my category pages and want them to be laid out in rows and columns, instead of just one long row.
Looking like this:
http://www.torontoactingstudios.com/Wordpress/studios/
Instead of like this:
http://www.torontoactingstudios.com/Wordpress/category/acting-technique/
I tried adding str_replace to my content.php file (I am using a child theme for twenty eleven) but no dice.
<?php else : ?>
<a href="<?php the_permalink() ?>">
<?php the_excerpt_rss();
$the_excerpt_rss = str_replace('<br />', '', $variable)
?>
</a>
<?php endif; ?>
Any suggestions? Perhaps I should be trying to modify my functions page instead?
Thanks!
ravZen
Member
Posted 8 months ago #
This is done with CSS - your style.css. Appears that your 3 columns are styled with the <div class="entry-content"> but your Acting Technique page is using all <div id="content" role="main">
heatherland
Member
Posted 8 months ago #
Hi ravZen,
Thanks so much for your response. I tried changing my style. Now both files are styled with <div class="entry-content">, but this didn't seem to solve the problem.
Perhaps I should have stated in my first email that the page that is is laid out in the way that I want, is not a result of the work of PHP or the LOOP, I simply added the images in myself
http://www.torontoactingstudios.com/Wordpress/studios/
I've seen other discussion of similar problems here:
http://wordpress.stackexchange.com/questions/4744/remove-line-breaks-in-wp-list-categories & here
http://wpquestions.com/question/show/id/342
I'm wondering if something like this might be a good solution:
function my_wpautop_correction() {
if( is_page() ) {
remove_filter( 'the_content', 'wpautop' );
remove_filter( 'the_excerpt', 'wpautop' );
}
}
add_action('pre_get_posts', 'my_wpautop_correction');'
But instead of 'is_page', maybe 'is_category'?
heatherland
Member
Posted 8 months ago #
I tried the below but no luck:
function my_wpautop_correction() {
if( is_category() ) {
remove_filter( 'the_content', 'wpautop' );
remove_filter( 'the_excerpt', 'wpautop' );
}
}
add_action('pre_get_category', 'my_wpautop_correction');'
heatherland
Member
Posted 8 months ago #
@heatherland,
Can you post the code from the page template being used for the category pages to pastebin.com and post the link here?
http://pastebin.com/
Thank you.
heatherland
Member
Posted 8 months ago #
Hi Rachel,
Thanks for having a look at this. It's content.php that calls the images through the_excerpt_rss();
http://pastebin.com/X5QGk6Zk
heatherland
Member
Posted 8 months ago #
Here's category.php, in case it is helpful
http://pastebin.com/BmF2SeQM
heatherland
Member
Posted 7 months ago #
If anyone out there is still mulling this one over, this site is now live and so the links have changed.
This is how I would like the logos to be displayed:
http://www.torontoactingstudios.com/studios/
This is how the PHP is laying out the pages:
http://www.torontoactingstudios.com/studios/category/acting-technique/
Thanks!
Heather