Mike Little
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Background images missingNo problems. You’ve already thanked me. That’s enough.
Don’t forget to mark the issue as resolved on the right hand sidebar.
Forum: Fixing WordPress
In reply to: Background images missingHi Jac123,
Your problem is that you have a complete copy of your style sheet in your header.
The style sheet references those background images relative to it’s own location, (which is correct), but when you copy those styles into your header, the images are not relative to the style’s location.
I presume you have either copied the stylesheet into a screen in the theme options page that allow you to tweak the styles, or you are using something like Automattic’s custom css plugin.
Try either turning the custom css plugin off, or removing the styles you have added to your theme’s set up page. That should fix your immediate problem.
However, that may undo some of the style tweaks you wanted to achieve.
It is important to know that in order to tweak the theme’s style, you only need to add the bits you want to change, not a copy of the whole thing.
Yes. That version fixes the problem. Thanks.
When will that be officially released?
I’m surprised to see you have issued another version (5.1.4.3) without fixing this 500 error.
What gives?
This patch will fix the problem.
--- buddypress/bp-em-groups.php.bak 2012-03-25 12:35:06.322139064 +0100 +++ buddypress/bp-em-groups.php 2012-03-25 12:35:06.322139064 +0100 @@ -82,6 +82,7 @@ if( is_user_logged_in() ){ global $wpdb; //find out what private groups they belong to, and don't show private group events not in their memberships + if (class_exists( 'BP_Groups_Member' ) ) { $group_ids = BP_Groups_Member::get_group_ids(get_current_user_id()); if( $group_ids['total'] > 0){ $conditions['group_privacy'] = "(<code>event_private</code>=0 OR (<code>event_private</code>=1 AND (<code>group_id</code> IS NULL OR <code>group_id</code> = 0)) OR (<code>event_private</code>=1 AND <code>group_id</code> IN (".implode(',',$group_ids['groups']).")))"; @@ -90,6 +91,7 @@ $conditions['group_privacy'] = "(<code>event_private</code>=0 OR (<code>event_private</code>=1 AND (<code>group_id</code> IS NULL OR <code>group_id</code> = 0)))"; } + } } return $conditions; } add_filter('em_events_build_sql_conditions','bp_em_group_events_build_sql_conditions',1,2);
I’ve just checked and if I turn on BuddyPress groups, the error goes away. So you should be checking whether groups are enabled (or that the class exists) before trying to use the class.
Forum: Plugins
In reply to: [SOPA Blackout] [Plugin: SOPA Blackout] Parse Error?I’ve seen the same problem on a client’s site. The problem is three short tags in the file.
Lines 153, 156, and 159 each have a short php tag at the end of the line. That is, there is a tag
<?
when it should be<?php
Fix those and the plugin will activate.
Forum: Hacks
In reply to: Removing comments from node based posts and change for category SOS pleaseYou could try something like this:
if ($show_meta) { $postheader .= '<span class="entry-meta"><span class="entry-comments">' . get_the_category_list( ', ' ) . '</span>'; $postheader .= '<abbr class="published" title="' . get_the_time('c') . '">' . get_the_time( get_option('date_format') ) . '</abbr></span>'; }
Forum: Hacks
In reply to: Need to add sponsor banner before posts on Category archive page SOSHopefully this is a little clearer (and with 4 options):
Change the ‘category-slug-1’, etc to your specific category slug.Mike
<?php if ( is_single() ) { if ( is_object_in_term( $post->ID, 'category', 'category-slug-1' ) ) { ?> <img src="https://example.com/wp-content/uploads/category-1-header.jpg" width="940" alt="<?php esc_attr( bloginfo( 'name' ) ); ?> header image" /> <? } else if ( is_object_in_term( $post->ID, 'category', 'category-slug-2' ) ) { ?> <img src="https://example.com/wp-content/uploads/category-2-header.jpg" width="940" alt="<?php esc_attr( bloginfo( 'name' ) ); ?> header image" /> <? } else if ( is_object_in_term( $post->ID, 'category', 'category-slug-3' ) ) { ?> <img src="https://example.com/wp-content/uploads/category-3-header.jpg" width="940" alt="<?php esc_attr( bloginfo( 'name' ) ); ?> header image" /> <? } else if ( is_object_in_term( $post->ID, 'category', 'category-slug-4' ) ) { ?> <img src="https://example.com/wp-content/uploads/category-4-header.jpg" width="940" alt="<?php esc_attr( bloginfo( 'name' ) ); ?> header image" /> <? } } ?>
Forum: Hacks
In reply to: Need to add sponsor banner before posts on Category archive page SOSThe code you showed only displays the image on the specified category archive pages, e.g. https://example.com/category/tools/
If you want to display a specific header for a single post in a specific category try something like this:
<?php if ( is_single() ) { if ( is_object_in_term( $post->ID, 'category', 'category-1' ) ) { ?> <img src="https://example.com/wp-content/uploads/category-1-header.jpg" width="940" alt="<?php esc_attr( bloginfo( 'name' ) ); ?> header image" /> <? } else if ( is_object_in_term( $post->ID, 'category', 'category-2' ) ) { ?> <img src="https://example.com/wp-content/uploads/category-2-header.jpg" width="940" alt="<?php esc_attr( bloginfo( 'name' ) ); ?> header image" /> <? } } ?>
Forum: Hacks
In reply to: Need to add sponsor banner before posts on Category archive page SOSIf you really have the backslash before the curly brace “\{“, then the code won’t work, you should just have curly brace “{“.
If you correct that, then code should work to output an image on the category archive page for category concepts and category tools.
Forum: Hacks
In reply to: photo of posts not expand measurement and not display the route?When you insert the photo into your post, look for the section labelled “Link URL” on the media upload screen.
Make sure to click the “None” button before you click “Inesrt into post”.
PS: You didn’t need to direct this question at me, many people could answer this.
Forum: Hacks
In reply to: Need to add sponsor banner before posts on Category archive page SOSThere is contact form on my site here https://zed1.com/contact-zed1
Forum: Hacks
In reply to: Need to add sponsor banner before posts on Category archive page SOSsomething like this:
function sponsor_banner_after($post) { static $already_run = false; if ( !$already_run) { if (is_category('category-1')) { ?> <a href="https://www.sponsor1.com/" target="_blank"><img src="/path/to/image1.jpg" /></a> <?php $already_run = true; } else if (is_category('category-2')) { ?> <a href="https://www.sponsor2.com/" target="_blank"><img src="/path/to/image2.jpg" /></a> <?php $already_run = true; } } } add_action('loop_end', 'sponsor_banner_after');
Forum: Hacks
In reply to: Need to add sponsor banner before posts on Category archive page SOSTry this:
function sponsor_banner($post) { static $already_run = false; if ( !$already_run) { if (is_category('sociedad')) { ?> <a href="https://www.domainsponsor.com/" target="_blank"><img src="/wordpress/wp-content/publicidad/usa.jpg" /></a> <?php $already_run = true; } else if (is_category('category2')) { ?> <a href="https://www.sponsor2.com/" target="_blank"><img src="/wordpress/wp-content/publicidad/image2.jpg" /></a> <?php $already_run = true; } } } add_action('the_post', 'sponsor_banner');