Custom Post Widget
[resolved] Custom Post Widget with qTranslate (2 posts)

  1. starnetwork
    Posted 4 years ago #

    on the Widget
    the Custom Post Widget work grate with the Multiple languages content
    and Display the content per language
    but the title is display The titles of all the languages ‚Äč‚Äčtogether

    Best Regards,
    Star Network.


  2. Johan van der Wijk
    Plugin Author

    Posted 4 years ago #

    Hi Shalom,

    Because the qTranslate plugin is quite complex I think the developer of that plugin might be in a better position to answer your question.

    As you can see by the code below, all the Custom Post Widget plugin does is to get the post_content and display the post_title if this is set in the widget:

    function widget($args, $instance)
        $custom_post_id  = ( $instance['custom_post_id'] != '' ) ? esc_attr($instance['custom_post_id']) : __('Find', 'custom-post-widget');
        /* Variables from the widget settings. */
        $show_custom_post_title = isset( $instance['show_custom_post_title'] ) ? $instance['show_custom_post_title'] : false;
        $content_post = get_post($custom_post_id);
        $content = $content_post->post_content;
        $content = apply_filters('the_content', $content);
        $content = str_replace(']]>', ']]>', $content);
        echo $before_widget;
        if ( $show_custom_post_title )
          echo $before_title . $content_post->post_title . $after_title; // This is the line that displays the title (only if show title is set)
        echo $content; // This is where the actual content of the custom post is being displayed
        echo $after_widget;

    I hope this helps in troubleshooting this issue.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Custom Post Widget
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic