WordPress Loop Prob

Right now it seems like there is no query regarding the amount of posts to be shown. Try adding this above your WHILE argument: global $query_string; query_posts( $query_string . ‘&posts_per_page=5’ );

Assign a category by user and customize the edit-tags.php?taxonomy=category page

This is how I did it : function if_restrict_categories($categories) { global $current_user; $a = get_cat_if_user($current_user->ID); $onPostPage = (strpos($_SERVER[‘PHP_SELF’], ‘edit-tags.php’)); if (is_admin() && $onPostPage && !current_user_can(‘level_10’)) { $size = count($categories); for ($i = 0; $i < $size; $i++) { if($categories[$i]->parent != $a && $categories[$i]->term_id != $a){ unset($categories[$i]); } } } return $categories; } add_filter(‘get_terms’, ‘if_restrict_categories’); And … Read more

How to make wp dropdown category load with selected option on top?

if the currently selected item has some type of identifier on it (maybe class=”current”) you may be able to use some jquery to grab it’s value, hide it, then move it to the top. <div class=”topdiv”> this is top div </div> <ul> <li>1</li> <li class=”current”>2</li> </ul> (function() { var top = $(‘.current’).html(); $(‘.current’).hide(); $(‘.topdiv’).text(top); })(); … Read more

Show custom menu in category and its posts

Well it looks like you are using theme that doesn’t have custom menu supporting code inside post and category templates. Since it’s working fine in page template you should go to Appearance -> Editor and open for editing page.php or index.php and look for wp_nav_menu() with all it’s arguments. Select and copy and insert it … Read more

Make a menu visible for a single category and it’s content

In order to display any specific conditional content on a single post based on it’s category, you have to edit the template called single.php. e.g. put something like this in single.php if ( in_category( ‘category1’ )) { //code for category1 } elseif ( in_category( array( ‘category2’, ‘category3’ ) )) { // code for when t … Read more

get latest post in category date

Unfortunately no; the categories are stored separately in the database and would each require their own query. I like to stick to built in wordpress functions as much as possible, but you could make a custom query to find the latest post from each category using the wp_term_relationships table. It stores the post id (object_id) … Read more

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

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)