Problems with explode [closed]

It’s because you’ve created an array with explode and assigned it to $string, then you’re appending strings onto it when you use the .= concatenation operator within your foreach loop. here’s a simpler method: $string = ‘-‘ . implode( ‘,-‘, explode( ‘ ‘, $data[‘exclude_categories’] ) );

Search functionality with multiple categories

Sounds like something Relevanssi could handle. With Relevanssi, you’d have the checkboxes to choose the categories. Then, you’d write a function to hook on ‘relevanssi_modify_wp_query’ filter, where you’d read the checkboxes and convert them to a comma-separated list of category ID’s. That you would store in $wp_query->query_vars[‘cats’] and hey presto, Relevanssi gives you relevant results … Read more

WordPress do_shortcode first iteration

Figured out both issues. You can keep a count and find out when you are on the first iteration in the same go. static $count; if(!$count) { $count = 1; $state=” active”; } else { $count++; $state=””; } From the PHP Manual. “A static variable exists only in a local function scope, but it does … Read more

My site looks different when activating new theme

You’re using WP Super Cache; reset the cache for the problem page(s) and it should display the new design. The reason it looks different when you’re logged in is because the static pages are served to Users who are not logged in. Users who have not left a comment on your blog. Or users who … Read more

Socialite not displaying icons [closed]

kaiser pointed me to firebug (FF addon) which confirmed what I thought, the css/js files were not being loaded correctly. But everthing seemed ok. I copied the css into my main styles sheet and things started to look better (however, some things still didnt work). I re-did the tutorial (for the fourth time), but this … Read more

Load featured article once in a loop

I was able to find a solution to my own problem. For anyone needing to solve this in the future, WordPress offers a set of conditional statements for just able everything, include pagination. <?php get_header(); ?> <?php if ( ! $paged || $paged < 2 ){ ?> <?php locate_template( ‘featured-post.php’, true, false ); ?> <?php … Read more