custom walker to add iconfont to wp_nav_menu

ok, I figured it out myself. instead of using the CSS class (as I cannot figure out how to filter it), I decided to use the description instead. under the lines with $attributes I have added this line: $description = ! empty( $item->description ) ? esc_attr( $item->description ) : ”; And then I added that … Read more

Custom Query Arguments

/** * Define a new function that uses $args and wp_parse_args() */ function explain_parse_args( $args ) { $defaults = array ( ‘text’ => ‘wp_parse_args() merges $args into $defaults’, ‘before’ => “”, ‘after’ => ” \n”, ‘echo’ => TRUE ); // Parse incomming $args into an array and merge it with $defaults $args = wp_parse_args( $args, … Read more

Custom PHP-coding in MU installs

With the Apache web server, one would create a rule in the .htaccess file. I believe the equivalent in IIS7 is the web.config file. This page appears to point in the right direction. I would be more specific about where to place the file or how to construct the rule, but I have no experience … Read more

Need Advice to Working with Custom Post Meta

If it where me id store each question as a ‘question’ type meta as a stored array. WordPress automatically serializes your array before storing it. So then when you use get_post_meta($post_id, ‘question’) it will return an array of serialized strings.(I think, Im pretty sure it wont unserialize it for you if there are more than … Read more

Custom MySQL query to list post

You don’t need to use query_posts function. It could be done without it. Use setup_postdata function to set up global post data. $sql = ” SELECT p.* FROM orders_items oi INNER JOIN products pr ON pr.`post_id` = oi.`product_id` INNER JOIN posts p ON p.`ID` = pr.`post_id` AND p.`post_type` = ‘product’ GROUP BY oi.`product_id` ORDER BY … Read more

Custom Post Title as search term

If you register the post type with public set to true, the titles will be included automatically. You shouldn’t have to do anything to make this happen. Something as simple as this from the Codex: function codex_custom_init() { $args = array( ‘public’ => true, ‘label’ => ‘Books’ ); register_post_type( ‘book’, $args ); } add_action( ‘init’, … Read more

Passing user meta through comment form

If you look in your theme’s comments.php file, you should see a call to wp_list_comments. If that has a callback parameter– something like this array( ‘callback’ => ‘twentyeleven_comment’ )— then your theme has its own comment display function. Find that function. It is probably in function.php but no promises. If not, you need to make … Read more

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