wp tilesbyline function
-
Hi
Great plugin and documentation, however im not sure if this is me or the plugin filter not working correctly.I am using a custom post type and want to show all the related categories set up in its taxonomy. I used some code form this support but the $post var has not data. I have made it work by hacking a few things but did not want to that.
I am running a filter prior to stop all attached images which post->ID gets the id however the tiles by line brings back nothing.
add_filter( ‘wp-tiles-byline’, ‘view_tile_byline_filter’ );
function view_tile_byline_filter( $byline, $post ) {
return my_get_the_id_function($post->ID);
//$post->ID always seem to be a blank or null}
function my_get_the_id_function($id){
$terms = get_the_terms($id, ‘type’ );
if ($terms && ! is_wp_error($terms)) :
$term_slugs_arr = array();
foreach ($terms as $term) {
$term_slugs_arr[] = $term->slug.’
‘;
}
$terms_slug_str = join( ” “, $term_slugs_arr);
endif;
$byline = $terms_slug_str;
return $byline;
}Is it me or the Plugin?
Thanks
W
- The topic ‘wp tilesbyline function’ is closed to new replies.