Forum Replies Created

Viewing 9 replies - 1 through 9 (of 9 total)
  • Thread Starter renemorin

    (@renemorin)

    Hello boybawang. Thanks for your answer! Have you found a replacement option? Really wish I could keep using Rimon’s, but…

    Thread Starter renemorin

    (@renemorin)

    Hey thanks VERY MUCH for your help Chouby! I think it works ?? Much, much appreciated! Does this have any noticeable side effects to the general behaviour of Polylang?

    Cheers,

    René

    Thread Starter renemorin

    (@renemorin)

    Thanks for the quik reply! This is all new to me, so I may need a little more help to make it work. Would you mind taking a look atthe below ccode from my header.php and tell me exactly where to implement your suggestion? Thanks a lot!

    <body <?php body_class(); ?>>
    
    <div id="page" class="hfeed">
    
    	<header id="branding" role="banner">
    			<hgroup>
    				<h1 id="site-title"><span><a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></span></h1>
    				<h2 id="site-description"><?php bloginfo( 'description' ); ?></h2>
    			</hgroup>
    
    			<?php
    				// Check to see if the header image has been removed
    				$header_image = get_header_image();
    				if ( $header_image ) :
    					// Compatibility with versions of WordPress prior to 3.4.
    					if ( function_exists( 'get_custom_header' ) ) {
    						// We need to figure out what the minimum width should be for our featured image.
    						// This result would be the suggested width if the theme were to implement flexible widths.
    						$header_image_width = get_theme_support( 'custom-header', 'width' );
    					} else {
    						$header_image_width = HEADER_IMAGE_WIDTH;
    					}
    					?>
    			<a href="<?php echo esc_url( home_url( '/' ) ); ?>">
    				<?php
    					// The header image
    					// Check if this is a post or page, if it has a thumbnail, and if it's a big one
    					if ( is_singular() && has_post_thumbnail( $post->ID ) &&
    							( /* $src, $width, $height */ $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), array( $header_image_width, $header_image_width ) ) ) &&
    							$image[1] >= $header_image_width ) :
    						// Houston, we have a new header image!
    						echo get_the_post_thumbnail( $post->ID, 'post-thumbnail' );
    					else :
    						// Compatibility with versions of WordPress prior to 3.4.
    						if ( function_exists( 'get_custom_header' ) ) {
    							$header_image_width  = get_custom_header()->width;
    							$header_image_height = get_custom_header()->height;
    						} else {
    							$header_image_width  = HEADER_IMAGE_WIDTH;
    							$header_image_height = HEADER_IMAGE_HEIGHT;
    						}
    						?>
    					<img src="<?php header_image(); ?>" width="<?php echo $header_image_width; ?>" height="<?php echo $header_image_height; ?>" alt="" />
    				<?php endif; // end check for featured image or standard header ?>
    			</a>
    			<?php endif; // end check for removed header image ?>
    <!--
    			<?php
    				// Has the text been hidden?
    				if ( 'blank' == get_header_textcolor() ) :
    			?>
    				<div class="only-search<?php if ( $header_image ) : ?> with-image<?php endif; ?>">
    				<?php get_search_form(); ?>
    				</div>
    			<?php
    				else :
    			?>
    				<?php get_search_form(); ?>
    			<?php endif; ?>
    -->
    			<nav id="access" role="navigation">
    				<h3 class="assistive-text"><?php _e( 'Main menu', 'twentyeleven' ); ?></h3>
    				<?php /* Allow screen readers / text browsers to skip the navigation menu and get right to the good stuff. */ ?>
    				<div class="skip-link"><a class="assistive-text" href="#content" title="<?php esc_attr_e( 'Skip to primary content', 'twentyeleven' ); ?>"><?php _e( 'Skip to primary content', 'twentyeleven' ); ?></a></div>
    				<div class="skip-link"><a class="assistive-text" href="#secondary" title="<?php esc_attr_e( 'Skip to secondary content', 'twentyeleven' ); ?>"><?php _e( 'Skip to secondary content', 'twentyeleven' ); ?></a></div>
    				<?php /* Our navigation menu. If one isn't filled out, wp_nav_menu falls back to wp_page_menu. The menu assigned to the primary location is the one used. If one isn't assigned, the menu with the lowest ID is used. */ ?>
    				<?php wp_nav_menu( array( 'theme_location' => 'primary' ) ); ?>
    			</nav><!-- #access -->
    	</header><!-- #branding -->
    
    	<div id="main">

    Works beautifully! Thanks Chouby ??

    Okay I tested it again and here’s precisely what happens.

    Before implementation: One post on the French home page, no post on English home page. Pages are accessible from the menu, but they are not shown on the home pages (i.e. only posts are shown on the home pages).

    After implementation: Pages now appear in the posts areaon the home pages, in the order in which they were published, with French pages displayed on the English home page when no translation is available (plus, for some reason, a draft post included in the mix on the English home page).

    I’ll be happy to test anything you send my way to fix this and report back to you in detail.

    Cheers,

    René

    Hi Chouby,

    Mucho thanks for your input! I tried the above on my index.php file, but what it does is replacing the post that was on the home page with the contents of a 2nd-level page (not a post!).

    What I want to do has to do with only posts (not pages). I understand Rutja76 wants to do the same. For instance, if my latest post is in French and there’s no translation for it, I’d like it to be shown on both French and English home pages. Likewise, if my latest post is in English and there’s no translation for it, I’d like it to be shown on both French and English home pages. But, if I’m providing a translation for a post, then of course the English version would be posted on the English home page and the French version would be posted on the French home page. Follow me?

    If you can help with that, that would be fantastic! In any case, thanks for your consideration have a great weekend!

    Rene

    To thenodon: did you figure out how to do this? I’m having the same issue and I’d really like to fix it…

    Cheers,

    Rene

    Hi there,

    Considering the above post. You may not have reveived my post from yesterday, so I’m reposting it here just in case. I hope you can help me fix my issue. Mucho thanks in advance for your consideration.

    My website is French/English, with French as the default language. I would like French posts to be displayed also on the English home page when no English translation is available (and vice versa). I tried copying the code you suggested in index.php, but then I’m getting a parse error like this:

    Parse error: syntax error, unexpected $end in /hermes/bosweb/web069/b695/nf.laboiteamots1/public_html/laboiteamots.ca/wp-content/themes/twentyeleven/index.php on line 61

    I’d be most grateful if you could help me fix this. This is all relatively new to me so please be very specific as to what I need to do.

    Nice work on Polylang, by the way. I love it!

    Cheers,

    Rene

    Hi there,

    I have the same need. My website is French/English, with French as the default language. I would like French posts to be displayed also on the French home page when no English translation is available. I tried copying the above code in index.php (at the end), but then I’m getting a parse error like this:

    Parse error: syntax error, unexpected $end in /hermes/bosweb/web069/b695/nf.laboiteamots1/public_html/laboiteamots.ca/wp-content/themes/twentyeleven/index.php on line 61

    I’d be most grateful if you could help me fix this. This is all relatively new to me so please be very specific as to what I need to do.

    Nice work on Polylang, by the way. I love it!

    Cheers,

    Rene

Viewing 9 replies - 1 through 9 (of 9 total)