• Resolved marcAroma

    (@marcaroma)


    Hi there,

    I am using your awesome plugin for a multiple language website, and also the Custom Content Shortcode plugin from Eliot Akira.

    But when I pull e,g, the title of a page/post it returns me all languages. Is there a way to get just the one the user currently selected?

    Thank you for your help!
    Marc

    https://www.ads-software.com/plugins/wpglobus/

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

    (@alexgff)

    hello,
    you can use next piece of code

    add_filter( 'ccs_loop_all_results', 'ccs_loop_all_results' );
    function ccs_loop_all_results( $results ) {
    
    	foreach( $results as $key=>$result ) {
    		$matches = array();
    		preg_match_all( '/{:[a-z]{2}}(.*){:}/m', $result, $matches );
    		if ( ! empty( $matches[0] ) ) {
    			foreach( $matches[0] as $match ) {
    
    				$results[ $key ] = str_replace( $match, WPGlobus_Core::text_filter($match, WPGlobus::Config()->language), $results[ $key ] );
    
    			}	
    
    		}
    	}
    	return $results;
    }

    Thread Starter marcAroma

    (@marcaroma)

    Hello Alex,
    How and where would I add this code in order to use it with https://www.ads-software.com/plugins/custom-content-shortcode/?

    Thank you,
    Marc

    Plugin Contributor Alex Gor

    (@alexgff)

    in file functions.php of your theme

    Thread Starter marcAroma

    (@marcaroma)

    Thank you Alex, I’ll give it a try ??

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘WPGlobus & Custom Content Shortcode’ is closed to new replies.