WP_Query for custom post type and category_id not working

category__in is used for built-in post categories, not for custom taxonomies. You can try something like this: $args = array( ‘post_type’ => ‘tribe_events’, ‘meta_query’ => array( array( ‘key’ => ‘_EventStartDate’, ‘value’ => array( $start_date, $end_date ), ‘compare’ => ‘BETWEEN’, ‘type’ => ‘DATE’ ) ), ‘tax_query’ => array( array( ‘taxonomy’ => ‘tribe_events_cat’, ‘field’ => ‘term_id’, ‘terms’ … Read more

the_tags : can we insert a class

Yes, it is possible. <?php $post_tags = get_the_tags(); if ($post_tags) { foreach($post_tags as $tag) { echo ‘<a href=”‘; echo bloginfo(); echo ‘/?tag=’ . $tag->slug . ‘” class=”‘ . $tag->slug . ‘”>’ . $tag->name . ‘</a>’; } } ?> The code is from another answer on Stack Overflow, see here for the source and more info

Difference between `is_serialized_string` and `is_serialized`

If you check the source code of is_serialized() and is_serialized_string(), the difference will become clear. is_serialized() checks if the data is serialized, whereas is_serialized_string() checks, if the serialized data is of type string. var_dump( is_serialized( serialize(NULL) ) ); // true var_dump( is_serialized_string( serialize(NULL) ) ); // false var_dump( is_serialized( serialize(array(1,2,3)) ) ); // true var_dump( … Read more

Breadcrumbs – get the author?

Call echo $GLOBALS[‘wp_query’]->query_vars[‘author_name’]; and it should show you the author. You can also echo $GLOBALS[‘wp_query’]->post->post_author; or echo $GLOBALS[‘wp_query’]->queried_object->post_author;. hope i didn’t mix up with arrays and objects.

WordPress from url get external source title

Here you go: class UrlToTitleConverter{ public function convert($Url){ $response = wp_remote_get($Url); if ( is_array( $response ) ) { $body = $response[‘body’]; $title = substr($body, strpos($body, ‘<title>’)+7); $title = substr($title, 0, strpos($title, ‘</title>’)); } return $title; } }

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