[resolved] Persist rendering for posts on the front page? (5 posts)

  1. dimers
    Posted 2 years ago #

    Hi, I have much table data in my posts I and would like the <table> rendering to persist in the posts listed on the front page. How can this be enabled? Is there an theme option to enable this? Currently the <table> rendering in posts on the home page is removed and the text in the <table> is displayed as a single unstructured string. <table> data in a post is rendered as such when a single post is displayed.

  2. bassjobsen
    Theme Author

    Posted 2 years ago #

    Thanks for your interesting question. to be honest, i have never test this before. I will do coming days to give you a solution.

    By default on the homepage the expert of the post will be shown. See also https://codex.wordpress.org/Excerpt (this filters HTML).

    I think the best solution will be to create a new template front-page.php and show posts with the_content() and use the more tag.

    Globally this template should look like that shown below:

    do_action( 'jbst_before_content_'.get_post_format());
    if ( have_posts() ) :
    	while ( have_posts() ) : the_post();
    do_action( 'jbst_after_content_'.get_post_format() );
  3. dimers
    Posted 2 years ago #

    I tried creating a 'front-page.php' with the code as you noted but this did not work as expected.

    I edited your content.php file in "themes/jbst" and swapped out 'the_excerpt()' for 'the_content()' on lines 49 and 69. This appears to work OK and preserves the HTML tags (the <table> displays).

    I prefer not to alter your theme files, can this be a new theme option to expose 'the_content()' or to 'the_excerpt()' on the main page and search result pages?

  4. bassjobsen
    Theme Author

    Posted 2 years ago #

    I will add that theme option before uploading the next version to wordpress.org. Thanks! See also: https://github.com/bassjobsen/jbst/issues/118

  5. bassjobsen
    Theme Author

    Posted 2 years ago #

    This issue is fixed, please see: https://github.com/bassjobsen/jbst/issues/118

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic