Forum Replies Created

Viewing 13 replies - 136 through 148 (of 148 total)
  • Thread Starter leslierad

    (@leslierad)

    I removed the filter from mqtranslate_hooks.php and the function now works correctly, apart from using another language for date text, but that may have been in my qtranslate .mo files don’t remember how I got it working before.

    add_filter(‘get_the_modified_date’, ‘qtrans_dateFromPostForCurrentLanguage’,0,2);

    Thread Starter leslierad

    (@leslierad)

    There is an error in correctly displaying the_modified_date it shows now the published date instead of the date the post was last modified.

    @ Uobet

    I wrote this to another user maybe it will help you so long

    Disable qtranslate then enable mqtranslate go to the settings page and import your qtranslate settings to mqtranslate.

    yoururl.com/wp-admin/options-general.php?page=mqtranslate#advanced_settings

    Under mqtranslate Settings:
    Open: Advanced Settings
    Find: Settings Migration
    Select: Import settings from qTranslate

    Save options, done

    I have never used TablePress but saw this for qtranslate, it may help you.

    https://tablepress.org/extensions/qtranslate-shortcodes/

    @vasch

    Looks like you had both mqtranslate and qtranslate active at the same time, disable qtranslate then enable mqtranslate go to the settings page and import your qtranslate settings to mqtranslate.

    yoururl.com/wp-admin/options-general.php?page=mqtranslate#advanced_settings

    Under mqtranslate Settings:
    Open: Advanced Settings
    Find: Settings Migration
    Select: Import settings from qTranslate

    Save options, done

    @jondewitt

    If you are worried about WP auto updates you could always change
    /wp-content/plugins/mqtranslate/mqtranslate.php

    From:
    — define(‘QT_MAX_SUPPORTED_WP_VERSION’, ‘3.9’);

    To:
    +++ define(‘QT_MAX_SUPPORTED_WP_VERSION’, get_bloginfo(‘version’));

    I just changed over to mqtranslate after years using qtranslate.

    I have noticed over the years Qian has been really busy at work no time for qtranslate, I saw the stats were 1,1 million downloads for his plugin, pity his time is limited hopefully the updated mqtranslate will remain up to date.

    Just for those who want to try you can import qtranslate settings into mqtranslate to try, but you can only have one of the plugins active at a time.

    My blog worked pretty much right away, only a couple changes needed with flag images and the bloginfo(home); calls.

    At least the visual editor now works and regular updates are made.

    This worked better for me
    <?php echo '<a href="'.get_bloginfo('url') .'/' .'"'?>

    Thanks Daniel,

    Your method works perfectly.

    Ok, here’s what I have so far, please share any changes you make:

    WPSEO ver. 1.5.2.5

    \wordpress-seo\js\wp-seo-metabox.js
    line 279

    -- var desc = jQuery.trim(yst_clean(descElm.val()));
    ++ var desc = jQuery.trim(descElm.val());

    save wp-seo-metabox.js as wp-seo-metabox.min.js

    in theme folder add to functions.php

    // Enable qTranslate for WordPress SEO
    if(defined("QT_SUPPORTED_WP_VERSION")) {
    	function qtranslate_filter($text){
    		return __($text);
    	}
    	add_filter('wpseo_title', 'qtranslate_filter', 10, 1);
    	add_filter('wpseo_metadesc', 'qtranslate_filter', 10, 1);
    	add_filter('wpseo_metakey', 'qtranslate_filter', 10, 1);
    	add_filter('wpseo_opengraph_title', 'qtranslate_filter', 10, 1);
    }
    function wpseo_qtranslate4($post_content) {
    if(function_exists('qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage')) $post_content = qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage($post_content);
    return $post_content;
    }
    add_filter('wpseo_heading_title4', 'wpseo_qtranslate4');

    \wp-content\plugins\wordpress-seo\admin\class-metabox.php
    line 1872

    -- $post_content = apply_filters( 'wpseo_pre_analysis_post_content', $post->post_content, $post );
    
    ++ $post_content = apply_filters( 'wpseo_heading_title4', $post->post_content, $post );

    This change is better to use original filter but when I was testing I used the changes listed and it seems to work.

    another filter on line 1138 haven’t tested it yet.

    with the changes above the Page analysis seems to work also I only see 1 lang in snippet preview, but focus keyword count is wrong.

    I can see all langs in seo title and meta description.

    If you or anyone else have further changes or improvements please add them.

    Sitemaps for langs changes:

    class-sitemaps.php (wordpress-seo/inc/) only add //Leslie ( some of the code around has been changed but you will see where to add it, thats why I left extra lines in place, also change yoursite.com, add/ remove langs as needed.)

    if ( $n == 1 ) {
    			$front_id = get_option( 'page_on_front' );
    			if ( ! $front_id && ( $post_type == 'post' || $post_type == 'page' ) ) {
    				$output .= $this->sitemap_url( array(
    					'loc' => home_url( '/' ),
    					'pri' => 1,
    					'chf' => 'daily',
    				) );
                    // Leslie Start - Home Page Langs in Page
                    $output .= $this->sitemap_url( array(
    					'loc' => home_url( '/da/' ),
    					'pri' => 0.9,
    					'chf' => 'daily',
    				) );
                    $output .= $this->sitemap_url( array(
    					'loc' => home_url( '/de/' ),
    					'pri' => 0.9,
    					'chf' => 'daily',
    				) );
                    $output .= $this->sitemap_url( array(
    					'loc' => home_url( '/es/' ),
    					'pri' => 0.9,
    					'chf' => 'daily',
    				) );
                    $output .= $this->sitemap_url( array(
    					'loc' => home_url( '/no/' ),
    					'pri' => 0.9,
    					'chf' => 'daily',
    				) );
                    $output .= $this->sitemap_url( array(
    					'loc' => home_url( '/pt/' ),
    					'pri' => 0.9,
    					'chf' => 'daily',
    				) );
                    $output .= $this->sitemap_url( array(
    					'loc' => home_url( '/sv/' ),
    					'pri' => 0.9,
    					'chf' => 'daily',
    				) );
                    $output .= $this->sitemap_url( array(
    					'loc' => home_url( '/fr/' ),
    					'pri' => 0.9,
    					'chf' => 'daily',
    				) );
                    $output .= $this->sitemap_url( array(
    					'loc' => home_url( '/nl/' ),
    					'pri' => 0.9,
    					'chf' => 'daily',
    				) );
                    $output .= $this->sitemap_url( array(
    					'loc' => home_url( '/it/' ),
    					'pri' => 0.9,
    					'chf' => 'daily',
    				) );
                    // Leslie End
    			}
    			else if ( $front_id && $post_type == 'post' ) {
    $url['images'] = apply_filters( 'wpseo_sitemap_urlimages', $url['images'], $p->ID );
    
    				if ( ! in_array( $url['loc'], $stackedurls ) ) {
    					// Use this filter to adjust the entry before it gets added to the sitemap
    					$url = apply_filters( 'wpseo_sitemap_entry', $url, 'post', $p );
    					if ( ! empty( $url ) ) {
    						$output .= $this->sitemap_url( $url );
                            // Leslie Start - Posts & Pages
                            // $output = str_replace(">0.6<", ">0.5<", $output);
                            $url = str_replace("yoursite.com/", "yoursite.com/da/", $url);
                            $output .= $this->sitemap_url( $url );
                            $url = str_replace("/da/", "/de/", $url);
                            $output .= $this->sitemap_url( $url );
                            $url = str_replace("/de/", "/es/", $url);
                            $output .= $this->sitemap_url( $url );
                            $url = str_replace("/es/", "/no/", $url);
                            $output .= $this->sitemap_url( $url );
                            $url = str_replace("/no/", "/pt/", $url);
                            $output .= $this->sitemap_url( $url );
                            $url = str_replace("/pt/", "/sv/", $url);
                            $output .= $this->sitemap_url( $url );
                            $url = str_replace("/sv/", "/fr/", $url);
                            $output .= $this->sitemap_url( $url );
                            $url = str_replace("/fr/", "/nl/", $url);
                            $output .= $this->sitemap_url( $url );
                            $url = str_replace("/nl/", "/it/", $url);
                            $output .= $this->sitemap_url( $url );
    						// Leslie End
                            $stackedurls[] = $url['loc'];
    					}
    				}
    
    				// Clear the post_meta and the term cache for the post, as we no longer need it now.
    				// wp_cache_delete( $p->ID, 'post_meta' );
    				// clean_object_term_cache( $p->ID, $post_type );
    $url['mod'] = $wpdb->get_var( $sql );
    			$url['chf'] = 'weekly';
    
    			// Use this filter to adjust the entry before it gets added to the sitemap
    			$url = apply_filters( 'wpseo_sitemap_entry', $url, 'term', $c );
    
    			if ( ! empty( $url ) )
    				$output .= $this->sitemap_url( $url );
                    // Leslie Start -Category
                    // $output = str_replace(">0.6<", ">0.5<", $output);
                            $url = str_replace("yoursite.com/", "yoursite.com/da/", $url);
                            $output .= $this->sitemap_url( $url );
                            $url = str_replace("/da/", "/de/", $url);
                            $output .= $this->sitemap_url( $url );
                            $url = str_replace("/de/", "/es/", $url);
                            $output .= $this->sitemap_url( $url );
                            $url = str_replace("/es/", "/no/", $url);
                            $output .= $this->sitemap_url( $url );
                            $url = str_replace("/no/", "/pt/", $url);
                            $output .= $this->sitemap_url( $url );
                            $url = str_replace("/pt/", "/sv/", $url);
                            $output .= $this->sitemap_url( $url );
                            $url = str_replace("/sv/", "/fr/", $url);
                            $output .= $this->sitemap_url( $url );
                            $url = str_replace("/fr/", "/nl/", $url);
                            $output .= $this->sitemap_url( $url );
                            $url = str_replace("/nl/", "/it/", $url);
                            $output .= $this->sitemap_url( $url );
    						// Leslie End
    		}
    
    		if ( empty( $output ) ) {
    			$this->bad_sitemap = true;
    			return;
    		}
    
    		$this->sitemap = '<urlset xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance" ';
    		$this->sitemap .= 'xsi:schemaLocation="https://www.sitemaps.org/schemas/sitemap/0.9 https://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd" ';
    		$this->sitemap .= 'xmlns="https://www.sitemaps.org/schemas/sitemap/0.9">' . "\n";
    		$this->sitemap .= $output . '</urlset>';
    	}
    
    	/**
    	 * Build the sub-sitemap for authors
    $this->sitemap = '<urlset xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance" xmlns:image="https://www.google.com/schemas/sitemap-image/1.1" ';
    		$this->sitemap .= 'xsi:schemaLocation="https://www.sitemaps.org/schemas/sitemap/0.9 https://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd" ';
    		$this->sitemap .= 'xmlns="https://www.sitemaps.org/schemas/sitemap/0.9">' . "\n";
    		$this->sitemap .= $output;
            // Leslie Start -Authors
            $output = str_replace("ty>0.8</pr", "ty>0.5</pr", $output);
            $output = str_replace("yoursite.com/", "yoursite.com/da/", $output);
            $this->sitemap .= $output;
            $output = str_replace("/da/", "/de/", $output);
            $this->sitemap .= $output;
            $output = str_replace("/de/", "/es/", $output);
            $this->sitemap .= $output;
            $output = str_replace("/es/", "/no/", $output);
            $this->sitemap .= $output;
            $output = str_replace("/no/", "/pt/", $output);
            $this->sitemap .= $output;
            $output = str_replace("/pt/", "/sv/", $output);
            $this->sitemap .= $output;
            $output = str_replace("/sv/", "/fr/", $output);
            $this->sitemap .= $output;
            $output = str_replace("/fr/", "/nl/", $output);
            $this->sitemap .= $output;
            $output = str_replace("/nl/", "/it/", $output);
            $this->sitemap .= $output;
            // Leslie End
    
    		// Filter to allow adding extra URLs, only do this on the first XML sitemap, not on all.
    		if ( $n == 0 )
    			$this->sitemap .= apply_filters( 'wpseo_sitemap_author_content', '' );
    
    		$this->sitemap .= '</urlset>';
    	}
    
    	/**
    	 * Spits out the XSL for the XML sitemap.

    Comment out images

    //if ( isset( $url['images'] ) && count( $url['images'] ) > 0 ) {
    		//	foreach ( $url['images'] as $img ) {
    		//		if ( ! isset( $img['src'] ) || empty( $img['src'] ) )
    		//			continue;
    		//		$output .= "\t\t<image:image>\n";
    		//		$output .= "\t\t\t<image:loc>" . esc_html( $img['src'] ) . "</image:loc>\n";
    		//		if ( isset( $img['title'] ) && ! empty( $img['title'] ) )
    		//			$output .= "\t\t\t<image:title>" . _wp_specialchars( html_entity_decode( $img['title'], ENT_QUOTES, get_bloginfo( 'charset' ) ) ) . "</image:title>\n";
    		//		if ( isset( $img['alt'] ) && ! empty( $img['alt'] ) )
    		//			$output .= "\t\t\t<image:caption>" . _wp_specialchars( html_entity_decode( $img['alt'], ENT_QUOTES, get_bloginfo( 'charset' ) ) ) . "</image:caption>\n";
    		//		$output .= "\t\t</image:image>\n";
    		//	}
    		//}

    I have the same issue as you, with WordPress SEO 1.5.2.2, try the below into js/wp-seo-metabox.min.js:

    function updateTitle(force) {
    	var title = '';
    	var titleElm = qtranslateParse(jQuery('#'+wpseoMetaboxL10n.field_prefix+'title'));
    	var titleLengthElm = qtranslateParse(jQuery('#'+wpseoMetaboxL10n.field_prefix+'title-length'));
    	var divHtml = jQuery('<div />');
    	var snippetTitle = jQuery('#wpseosnippet').find('.title');

    My issue is that it strips the [en:]and langs from the meta description, the rest seems ok, but I know the author does not support qtranslate unfortunately.

    I have exactly the same issue,

    It seems very little support is available for cache by geoip in wordpress.

    I would love to use W3 Total cache but it seems from what I read so far that SuperCache may well be better for your instance check under:
    How do I make certain parts of the page stay dynamic? on the FAQ page

    Not sure if a similar option exists for W3 Cache from what I read so far its seems that w3 cache lets you deselect a page from caching but thats about all.

    Unfortunately for me, I want to be able to cache on a way more advanced level including a cache for mobile, language and country.

    Something like this super cache with geo-ip targeting with some more options added would be perfect.

    I’m still in my early stages of research into caching by Geoip but I read those options existed and thought it may be of help to you.

    Thanks Omidneo your first suggestions corrected my site, was paranoid that something had been injected…..whew
    #fb_xdm_frame_http, #fb_xdm_frame_https { display:none; border:none; }

Viewing 13 replies - 136 through 148 (of 148 total)