Skip to main content
replaced http://wordpress.stackexchange.com/ with https://wordpress.stackexchange.com/
Source Link

I'm using Last Viewed Posts (LVP) plugin on a qTranslate-enabled website. LVP shows post titles in both languages. I found this hint: titles in recent posts appear together in all languages with qtranslatetitles in recent posts appear together in all languages with qtranslate

But not sure how to apply this filter. Relevant code in LVP:

        foreach ($zg_post_IDs as $value) { // Do output as long there are posts
        global $wpdb;
        $zg_get_title = $wpdb->get_results("SELECT post_title FROM $wpdb->posts WHERE ID = '$value+0' LIMIT 1");
        foreach($zg_get_title as $zg_title_out) {
            echo "<a href=\"". get_permalink($value+0) . "\" title=\"". $zg_title_out->post_title . "\">". $zg_title_out->post_title . "</a>, \n"; // Output link and title
        }

Instead of echo $post->post_title; it has $zg_title_out->post_title.

Replacing the whole zg string with apply_filters('the_title',$post->post_title) didn't work.

I'm using Last Viewed Posts (LVP) plugin on a qTranslate-enabled website. LVP shows post titles in both languages. I found this hint: titles in recent posts appear together in all languages with qtranslate

But not sure how to apply this filter. Relevant code in LVP:

        foreach ($zg_post_IDs as $value) { // Do output as long there are posts
        global $wpdb;
        $zg_get_title = $wpdb->get_results("SELECT post_title FROM $wpdb->posts WHERE ID = '$value+0' LIMIT 1");
        foreach($zg_get_title as $zg_title_out) {
            echo "<a href=\"". get_permalink($value+0) . "\" title=\"". $zg_title_out->post_title . "\">". $zg_title_out->post_title . "</a>, \n"; // Output link and title
        }

Instead of echo $post->post_title; it has $zg_title_out->post_title.

Replacing the whole zg string with apply_filters('the_title',$post->post_title) didn't work.

I'm using Last Viewed Posts (LVP) plugin on a qTranslate-enabled website. LVP shows post titles in both languages. I found this hint: titles in recent posts appear together in all languages with qtranslate

But not sure how to apply this filter. Relevant code in LVP:

        foreach ($zg_post_IDs as $value) { // Do output as long there are posts
        global $wpdb;
        $zg_get_title = $wpdb->get_results("SELECT post_title FROM $wpdb->posts WHERE ID = '$value+0' LIMIT 1");
        foreach($zg_get_title as $zg_title_out) {
            echo "<a href=\"". get_permalink($value+0) . "\" title=\"". $zg_title_out->post_title . "\">". $zg_title_out->post_title . "</a>, \n"; // Output link and title
        }

Instead of echo $post->post_title; it has $zg_title_out->post_title.

Replacing the whole zg string with apply_filters('the_title',$post->post_title) didn't work.

deleted 237 characters in body
Source Link
Phantasmix
  • 150
  • 1
  • 15

I'm using Last Viewed Posts (LVP) plugin on a qTranslate-enabled website. LVP shows post titles in both languages. I found this hint: titles in recent posts appear together in all languages with qtranslate

But not sure how to apply this filter. Relevant code in LVP:

        foreach ($zg_post_IDs as $value) { // Do output as long there are posts
        global $wpdb;
        $zg_get_title = $wpdb->get_results("SELECT post_title FROM $wpdb->posts WHERE ID = '$value+0' LIMIT 1");
        foreach($zg_get_title as $zg_title_out) {
            echo "<a href=\"". get_permalink($value+0) . "\" title=\"". $zg_title_out->post_title . "\">". $zg_title_out->post_title . "</a>, \n"; // Output link and title
        }

Instead of echo $post->post_title; it has $zg_title_out->post_title.

Replacing the whole zg string with apply_filters('the_title',$post->post_title) didn't work.

EDITED to add solution:

foreach($zg_get_title as $post) { echo "<a href=\"". get_permalink($value+0) . "\" title=\"". $post->post_title . "\">". apply_filters('the_title',$post->post_title) . "</a>; \n"; // Output link and title

I'm using Last Viewed Posts (LVP) plugin on a qTranslate-enabled website. LVP shows post titles in both languages. I found this hint: titles in recent posts appear together in all languages with qtranslate

But not sure how to apply this filter. Relevant code in LVP:

        foreach ($zg_post_IDs as $value) { // Do output as long there are posts
        global $wpdb;
        $zg_get_title = $wpdb->get_results("SELECT post_title FROM $wpdb->posts WHERE ID = '$value+0' LIMIT 1");
        foreach($zg_get_title as $zg_title_out) {
            echo "<a href=\"". get_permalink($value+0) . "\" title=\"". $zg_title_out->post_title . "\">". $zg_title_out->post_title . "</a>, \n"; // Output link and title
        }

Instead of echo $post->post_title; it has $zg_title_out->post_title.

Replacing the whole zg string with apply_filters('the_title',$post->post_title) didn't work.

EDITED to add solution:

foreach($zg_get_title as $post) { echo "<a href=\"". get_permalink($value+0) . "\" title=\"". $post->post_title . "\">". apply_filters('the_title',$post->post_title) . "</a>; \n"; // Output link and title

I'm using Last Viewed Posts (LVP) plugin on a qTranslate-enabled website. LVP shows post titles in both languages. I found this hint: titles in recent posts appear together in all languages with qtranslate

But not sure how to apply this filter. Relevant code in LVP:

        foreach ($zg_post_IDs as $value) { // Do output as long there are posts
        global $wpdb;
        $zg_get_title = $wpdb->get_results("SELECT post_title FROM $wpdb->posts WHERE ID = '$value+0' LIMIT 1");
        foreach($zg_get_title as $zg_title_out) {
            echo "<a href=\"". get_permalink($value+0) . "\" title=\"". $zg_title_out->post_title . "\">". $zg_title_out->post_title . "</a>, \n"; // Output link and title
        }

Instead of echo $post->post_title; it has $zg_title_out->post_title.

Replacing the whole zg string with apply_filters('the_title',$post->post_title) didn't work.

added 239 characters in body
Source Link
Phantasmix
  • 150
  • 1
  • 15

I'm using Last Viewed Posts (LVP) plugin on a qTranslate-enabled website. LVP shows post titles in both languages. I found this hint: titles in recent posts appear together in all languages with qtranslate

But not sure how to apply this filter. Relevant code in LVP:

        foreach ($zg_post_IDs as $value) { // Do output as long there are posts
        global $wpdb;
        $zg_get_title = $wpdb->get_results("SELECT post_title FROM $wpdb->posts WHERE ID = '$value+0' LIMIT 1");
        foreach($zg_get_title as $zg_title_out) {
            echo "<a href=\"". get_permalink($value+0) . "\" title=\"". $zg_title_out->post_title . "\">". $zg_title_out->post_title . "</a>, \n"; // Output link and title
        }

Instead of echo $post->post_title; it has $zg_title_out->post_title.

Replacing the whole zg string with apply_filters('the_title',$post->post_title) didn't work.

EDITED to add solution:

foreach($zg_get_title as $post) { echo "<a href=\"". get_permalink($value+0) . "\" title=\"". $post->post_title . "\">". apply_filters('the_title',$post->post_title) . "</a>; \n"; // Output link and title

I'm using Last Viewed Posts (LVP) plugin on a qTranslate-enabled website. LVP shows post titles in both languages. I found this hint: titles in recent posts appear together in all languages with qtranslate

But not sure how to apply this filter. Relevant code in LVP:

        foreach ($zg_post_IDs as $value) { // Do output as long there are posts
        global $wpdb;
        $zg_get_title = $wpdb->get_results("SELECT post_title FROM $wpdb->posts WHERE ID = '$value+0' LIMIT 1");
        foreach($zg_get_title as $zg_title_out) {
            echo "<a href=\"". get_permalink($value+0) . "\" title=\"". $zg_title_out->post_title . "\">". $zg_title_out->post_title . "</a>, \n"; // Output link and title
        }

Instead of echo $post->post_title; it has $zg_title_out->post_title.

Replacing the whole zg string with apply_filters('the_title',$post->post_title) didn't work.

I'm using Last Viewed Posts (LVP) plugin on a qTranslate-enabled website. LVP shows post titles in both languages. I found this hint: titles in recent posts appear together in all languages with qtranslate

But not sure how to apply this filter. Relevant code in LVP:

        foreach ($zg_post_IDs as $value) { // Do output as long there are posts
        global $wpdb;
        $zg_get_title = $wpdb->get_results("SELECT post_title FROM $wpdb->posts WHERE ID = '$value+0' LIMIT 1");
        foreach($zg_get_title as $zg_title_out) {
            echo "<a href=\"". get_permalink($value+0) . "\" title=\"". $zg_title_out->post_title . "\">". $zg_title_out->post_title . "</a>, \n"; // Output link and title
        }

Instead of echo $post->post_title; it has $zg_title_out->post_title.

Replacing the whole zg string with apply_filters('the_title',$post->post_title) didn't work.

EDITED to add solution:

foreach($zg_get_title as $post) { echo "<a href=\"". get_permalink($value+0) . "\" title=\"". $post->post_title . "\">". apply_filters('the_title',$post->post_title) . "</a>; \n"; // Output link and title

Source Link
Phantasmix
  • 150
  • 1
  • 15
Loading