Home Forums Square Add custom HTML instead of slider, and show posts

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #3019
    PeterK2
    Participant

    Hello

    I need show posts on front page, so I deleted front-page.php from theme, but instead of header image I want post HTML code only front page with posts, how can I do that? I’m familiar with PHP.

    And second thing, I want insert actually some code from plugin Visual Composer, so the html code contain shortcodes, will these shortcodes work, if I insert them to .php files?

    MANY thanks.

    #3034
    PeterK2
    Participant

    If anyone need this:

    index.php:10

    <?php if ( !is_front_page() ) : ?>
    <header class="sq-main-header">
    ...keep original header code here...
    </header><!-- .entry-header -->
    <?php else : ?>
    ...your HTML code here...
    <?php endif; ?>
    #3037
    PeterK2
    Participant

    And if you want use another page so you don’t need generate html code (you can set this page to private if you want) use this code few lines below in index.php.

    <div class="sq-container sq-clearfix">
    <?php if ( is_front_page() )
      echo apply_filters( 'the_content', get_post_field( 'post_content', '123') );
    ?>

    replace 123 with your page’s number

    #3066
    Hash
    Keymaster

    Great. Seems you figured out.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.