I am trying to: insert taxonomy "category" term "spalva" in post view
I visited this URL: local development
I expected to see: taxonomy "category" term "spalva" displayed in post view
Instead, I got: empty if i insert [types termmeta='spalva'][/types]
If I create and insert taxonomy view it distorts whole design
<div class="col-xs-1"><div style="background-color:[wpv-view name="skelbimai-taxonomy-colour"];"></div></div>
you can see it in screenshot
Minesh
Supporter
Languages:
English (English )
Timezone:
Asia/Kolkata (GMT+05:30)
Hello. Thank you for contacting the Toolset support.
As I understand you want to just display plain text output from your view. If this is correct - to display plain text only output with view's you need to add following code to your current theme's functions.php file.
add_filter( 'wpv_filter_wpv_view_shortcode_output', 'prefix_clean_view_output', 5, 2 );
function prefix_clean_view_output( $out, $id ) {
if ( $id == '999' ) { //Please adjust to your Views ID
$start = strpos( $out, '<!-- wpv-loop-start -->' );
if (
$start !== false
&& strrpos( $out, '<!-- wpv-loop-end -->', $start ) !== false
) {
$start = $start + strlen( '<!-- wpv-loop-start -->' );
$out = substr( $out , $start );
$end = strrpos( $out, '<!-- wpv-loop-end -->' );
$out = substr( $out, 0, $end );
}
}
return $out;
}
Where:
Replace '9999' with your original view ID.
Thank you ! it works like a charm.
Is there a possibility to add 2 or more view ID's in same function?
Minesh
Supporter
Languages:
English (English )
Timezone:
Asia/Kolkata (GMT+05:30)
Yes - you can use the following code:
add_filter( 'wpv_filter_wpv_view_shortcode_output', 'prefix_clean_view_output', 5, 2 );
function prefix_clean_view_output( $out, $id ) {
// Replace your view ids comma separated with folloing array
$view_ids = array(999,222);
if (in_array($id, $view_ids)) {
$start = strpos( $out, '<!-- wpv-loop-start -->' );
if (
$start !== false
&& strrpos( $out, '<!-- wpv-loop-end -->', $start ) !== false
) {
$start = $start + strlen( '<!-- wpv-loop-start -->' );
$out = substr( $out , $start );
$end = strrpos( $out, '<!-- wpv-loop-end -->' );
$out = substr( $out, 0, $end );
}
}
return $out;
}
I hope above solution will help you to resolve your issue.