WordPress.org

Ready to get started?Download WordPress

Forums

Polylang
posts only display titles, no content (31 posts)

  1. robcarroll
    Member
    Posted 1 year ago #

    Hi,

    I'm using a static home page with a separate blog page in the responsive theme.

    Language switching (french-english) with Polylang is working great. But, posts are not displayed properly. If I disable Polylang, they show up as expected.

    permalinks setting = default
    polylang version 1.01
    Responsive theme v. 1.8.9.3

    Checking the post page with validator shows some html tags errors are being generated.

    http://validator.w3.org/check?uri=http%3A%2F%2Fcaf.rsmrecords.com%2F%3Fp%3D308&charset=%28detect+automatically%29&doctype=Inline&group=0

    The site under development is at http://www.caf.rsmrecords.com, blog page is linked from the seminars menu in the english version.

    Any help would be appreciated.

    http://wordpress.org/extend/plugins/polylang/

  2. Chouby
    Member
    Plugin Author

    Posted 1 year ago #

    How did you setup your blog page? you choose the blog template?

  3. robcarroll
    Member
    Posted 1 year ago #

    I used the blog template.

    Also tried the blog(excepts) one but same result.

  4. Chouby
    Member
    Plugin Author

    Posted 1 year ago #

    I tried several combinations of settings and did not reproduce same thing. Could you describe What your settings are (polylang + 'front page displays' in reading settings)?

    Are you sure there is not a conflict with another plugin?

  5. robcarroll
    Member
    Posted 1 year ago #

    The only other active plugin is Sidebar Login.

    Disabling it doesn't change the behaviour of the posts page.

    I do have some other plugins that are installed but disabled. Membership, and s2member@Framework are the only ones I've added. Others were part of WordPress install on my host's site.

    Akismet, Hello Dolly, Jetpack, SiteWit, UppSite-GoMobile.

    Reading Settings are:

    Front page displays Static page (check box)-set to "Welcome to the home page..."
    Posts page -set to "Select", choosing the assigned blog page throws a 404 error.

    I'm not sure which Polylang settings you are asking about. There is only English & French on the site.

    On the setting tab Plugins/Polylang/Settings:

    Detect Browser language: yes
    URL Modifications: set from content
    Static front page redirect language page: yes
    Media activate languages: yes
    Synchronization: all checked

    I can try actually deleting the disabled plugins, if that might help.

    thanks,

    rob

  6. Chouby
    Member
    Plugin Author

    Posted 1 year ago #

    I don't understand... I chose exactly the same settings as you, used the same versions of WP, Polylang and Responsive, even downloaded Sidebar login and I do not succeed to reproduce the same issue as on your site :(

    It seems that the execution is brutally stopped as the page is not displayed correctly (html tags are not closed).

    Maybe you should try to set WP_DEBUG to true in your wp-config.php and look if errors are outputed.

  7. robcarroll
    Member
    Posted 1 year ago #

    Hi,

    I finally had time try the debug setting.

    This error shows repeatedly in the debug.log file:

    [07-Mar-2013 19:53:13] PHP Notice: Undefined index: QUERY_STRING in /hermes/bosoraweb052/b2875/dot.robcarroll/testCAF/wp-content/plugins/polylang/include/core.php on line 419

    What should I do to fix it?

    thanks,

    rob

  8. Chouby
    Member
    Plugin Author

    Posted 1 year ago #

    To remove the notice, try replacing the line 419 by:

    wp_redirect(empty($_SERVER['QUERY_STRING']) ? $redirect : $redirect . ($wp_rewrite->using_permalinks() ? '?' : '&') . $_SERVER['QUERY_STRING']);

    According to search results, this notice should appear on IIS, not on Apache.

  9. robcarroll
    Member
    Posted 1 year ago #

    OK. I made that edit.

    Now I get a server error if i try to go back to the site at all.

    Internal Server Error

    The server encountered an internal error or misconfiguration and was unable to complete your request.

    Please contact the server administrator, cgiadmin@yourhostingaccount.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.

    More information about this error may be available in the server error log.

    rob

  10. robcarroll
    Member
    Posted 1 year ago #

    OK. it was the text encoding. Server error is gone. The line at 419 has been replaced.

    I deleted the debug.log file because I couldn't see a way to clear the past entries. Hopefully a new log will be generated. The blog posts are still only showing titles as before.

    rob

  11. Chouby
    Member
    Plugin Author

    Posted 1 year ago #

    I wasn't expecting this would solve the main issue.
    Have you other errors logged?

    Just in case, since we started on this 4 weeks ago, could you update to the latest version of Polylang?

    Then edit the file single.php in your theme directory. Replace the line 38:

    <?php responsive_post_meta_data(); ?>

    by

    <?php
    echo get_permalink();
    echo get_the_time();
    echo get_the_date();
    echo get_the_author_meta( 'ID' );
    echo get_author_posts_url( get_the_author_meta( 'ID' ) );
    echo get_the_author();
    ?>

    And tell me when you have done this so that I check the result on your site. This will not solve the issue but maybe help debugging...

  12. robcarroll
    Member
    Posted 1 year ago #

    OK. I have made that edit.

    After I deleted the other debug.log file, I don't see any new one. The WP-config.php file is still set to log errors to the debug file.

  13. Chouby
    Member
    Plugin Author

    Posted 1 year ago #

    Can you replace the same line by:

    <?php
    echo 1;
    echo home_url();
    echo 2;
    echo home_url('?p=332');
    echo 3;
    echo get_permalink();
    ?>
  14. robcarroll
    Member
    Posted 1 year ago #

    OK. I've done that.

  15. Chouby
    Member
    Plugin Author

    Posted 1 year ago #

    There is something wrong... It seems that you have badly commented the original line in:

    //<?php responsive_post_meta_data(); ?>

    The right way to comment is:

    <?php //responsive_post_meta_data(); ?>

    If I am right, then we must restart the first test... but let's forget the first way and do it like this:

    <?php
    echo 1;
    echo home_url();
    echo 2;
    echo home_url('?p=332');
    echo 3;
    echo get_permalink();
    echo 4;
    echo get_the_time();
    echo 5;
    echo get_the_date();
    echo 6;
    echo get_the_author_meta( 'ID' );
    echo 7;
    echo get_author_posts_url( get_the_author_meta( 'ID' ) );
    echo 8;
    echo get_the_author();
    ?>

    If I am wrong, then it means that there is some code between

    <div class="post-meta">

    and the line we are replacing, which should not be there.

  16. robcarroll
    Member
    Posted 1 year ago #

    Hi,

    Yes, you are right. I have replaced the commented out code with this:
    `<?php
    //responsive_post_meta_data();
    ?>
    <?php
    // echo get_permalink();
    // echo get_the_time();
    // echo get_the_date();
    // echo get_the_author_meta( 'ID' );
    // echo get_author_posts_url( get_the_author_meta( 'ID' ) );
    // echo get_the_author();
    ?>
    I have replaced the previous code with your latest suggestion and updated the file on the server.

    thanks,

    rob

  17. robcarroll
    Member
    Posted 1 year ago #

    So this edit made a difference to the post page itself. Now the content is displayed, as well as the info.

    What would be necessary to get this to work on the blog page (seminars)?

    rob

  18. Chouby
    Member
    Plugin Author

    Posted 1 year ago #

    You can reset your file single.php.
    The problem is coming from the function 'responsive_post_meta_data' but what is very strange is that all the fonctions called by 'responsive_post_meta_data' are working as expected (this what we just tested).

    Could you open the responsive/includes/functions.php, go to line 350 and post the content of the function 'responsive_post_meta_data' between

    if (!function_exists('responsive_post_meta_data')) :

    and

    endif;
  19. robcarroll
    Member
    Posted 1 year ago #

    if (!function_exists('responsive_post_meta_data')) :

    function responsive_post_meta_data() {
    printf( __( '<span class="%1$s">Posted on </span>%2$s<span class="%3$s"> by </span>%4$s', 'responsive' ),
    'meta-prep meta-prep-author posted',
    sprintf( '<span class="timestamp">%3$s</span>',
    get_permalink(),
    esc_attr( get_the_time() ),
    get_the_date()
    ),
    'byline',
    sprintf( '<span class="author vcard">%3$s</span>',
    get_author_posts_url( get_the_author_meta( 'ID' ) ),
    sprintf( esc_attr__( 'View all posts by %s', 'responsive' ), get_the_author() ),
    get_the_author()
    )
    );
    }
    endif;

    How do you create the code blocks in these posts? The code button doesn't appear to do anything.

  20. Chouby
    Member
    Plugin Author

    Posted 1 year ago #

    You have to select all your code and then click on the code button. It will add one inverted quote at the beginning and another one at the end. You obtain a better display if the first quote is left alone on its line.

    Well, even if your code is not correctly displayed, it seems to be the same as I have and I still do not understand what happens. You should update to the latest version 1.8.9.3 but that will probably not change that...

    Have you a child theme or a custom plugin which could define the function first?
    To quickly check that, you can just put

    echo 'here';

    just after

    function responsive_post_meta_data() {

    and check that 'here' is displayed on your site.

  21. robcarroll
    Member
    Posted 1 year ago #

    OK. So I went back to the original version of the single.php file. And inserted the echo 'here' line into functions.php.

    The blog page and blog posts once again just show the post tile only with the text 'here' displayed. Another odd behaviour is that the upper menu bar (with the login info etc) does not get displayed on either of these pages.

    I'm not using any child theme or custom plugins.

  22. Chouby
    Member
    Plugin Author

    Posted 1 year ago #

    Another odd behaviour is that the upper menu bar (with the login info etc) does not get displayed on either of these pages.

    That's normal because WordPress brutally stops in the function 'responsive_post_meta_data' for a reason I ignore

    Could you update the theme to the latest version?

    After that, if you still have the problem, you can comment the whole function like this:

    function responsive_post_meta_data() {
    /*
    	printf( __( '<span class="%1$s">Posted on </span>%2$s<span class="%3$s"> by </span>%4$s', 'responsive' ),
    	'meta-prep meta-prep-author posted',
    	sprintf( '<a href="%1$s" title="%2$s" rel="bookmark"><span class="timestamp">%3$s</span></a>',
    		get_permalink(),
    		esc_attr( get_the_time() ),
    		get_the_date()
    	),
    	'byline',
    	sprintf( '<span class="author vcard"><a class="url fn n" href="%1$s" title="%2$s">%3$s</a></span>',
    		get_author_posts_url( get_the_author_meta( 'ID' ) ),
    		sprintf( esc_attr__( 'View all posts by %s', 'responsive' ), get_the_author() ),
    		get_the_author()
    	    )
    	);
    */
    }

    This should prevent the wrong code to be executed. But not finding what happens is driving me crazy!

  23. robcarroll
    Member
    Posted 1 year ago #

    I have the most up to date version of Responsive and WordPress itself already. I may try to do a clean install of both.

    Anyway, fully commenting out the function above seems to fix this issue.

    thanks,

    rob

  24. mica123
    Member
    Posted 7 months ago #

    Hello,

    I am not sure if you are following this thread. I would very much like to ask a question regarding the commented out function you refer to above. I hope I can, please, let me know and I'll come back to you.

  25. robcarroll
    Member
    Posted 7 months ago #

    Hi,

    I just saw this. I haven't been actively following this thread lately. Not sure if I can be of any help.

    regards,

    rob

  26. mica123
    Member
    Posted 7 months ago #

    Hello,

    many thanks for getting back to me. Well, I am interested in your experience with the commented out function for post_meta_data because I'd like to remove the date and author from the source code (not just hide them using CSS). Although this is not what you were asking for in this thread, I am just wondering if you used this method on your site and if you had any problems with it? I would like to implement this code in my child theme, but I would prefer to be on the safe side - hence my question.
    Many thanks for your understanding.

  27. robcarroll
    Member
    Posted 7 months ago #

    I did use that method in the live site and didn't have any problem. At least with a child theme, you can easily revert to the original code if anything changes with theme updates or other plugin issues.

  28. mica123
    Member
    Posted 7 months ago #

    This is extremely helpful, indeed. I would use it in the child theme. Just one more question if I may: did you use the code exactly as displayed above by Chouby without the preceding "if( !function_exists(etc etc )" and without the "end if;" at the end of the code from the original code in the parent theme?
    Many thanks for your patience.

  29. robcarroll
    Member
    Posted 7 months ago #

    I just looked at the relevant code in the active site, and I no longer have that function commented out. Offhand, I can't remember what was identified as the core issue that was blocking the post content. We ran into some problems because it is a bi-lingual site. However, I think for a while I had the function commented exactly as Chouby has it in his reply.

  30. mica123
    Member
    Posted 7 months ago #

    Many thanks for taking all this trouble.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic