• Resolved sergey81

    (@sergey81)


    Hello.
    Can I hide the post without translation?

    Can I write something like this

    <div
    <?php if( WPGlobus::… -> … ) { ?>
    class=’hidden’
    <?php } ?>
    >….</div>

    ?

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Contributor Alex Gor

    (@alexgff)

    There is module Publish as part of WPGlobus Plus
    https://wpglobus.com/product/wpglobus-plus/#publish

    • This reply was modified 5 years, 1 month ago by Alex Gor.
    Thread Starter sergey81

    (@sergey81)

    I think must be a free way to do this.
    For exemple:


    $post_link = get_post_permalink();

    $post_text = file_get_content( $post_link );

    if( $post_text…. ){

    }
    is it?

    Can I take one translation on page of other translation?

    Plugin Contributor Alex Gor

    (@alexgff)

    To get any kind of content in the current language (post title, post content, meta value, etc.), you can use the text_filter function
    https://github.com/WPGlobus/WPGlobus/blob/develop/includes/class-wpglobus-core.php#L24

    
    $content_in_current_language = WPGlobus_Core::text_filter ($content_with_language_marks, WPGlobus::Config()->language, WPGlobus::RETURN_EMPTY);

    If $content_in_current_language is empty, it means that the translation does not exist.
    You can replace WPGlobus::Config()->language with any value from WPGlobus::Config()->enabled_languages array.

    Thread Starter sergey81

    (@sergey81)

    Sorry, it’s too hard for me.

    There is code:

    <?php
    if (have_posts()) {
    while (have_posts()) {
    the_post();
    the_title();
    the_content();
    }
    }
    How to check another translation empty is?
    Is it posible?

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘hide post’ is closed to new replies.