Premium WordPress Themes, Templates & Plugins › Support › WordPress Theme Support › Cosmos › add snippet in home page
- This topic has 5 replies, 2 voices, and was last updated 7 years, 11 months ago by ThemeofWP.
- AuthorPosts
-
- February 14, 2017 at 12:23 pm #8731filippocataniaParticipant
Sorry for my question, but I know little php and html.
I have a website http://www.filippocatania.it that I built with Cosmos theme.I need to insert a snippet in the home page code before the tag </body>: I saw in the Appareance -> Editor but I have not found this tag.
How add it?Thanks
Best regards
Filippo
- February 14, 2017 at 4:28 pm #8732filippocataniaParticipant
Can you write me the complete path of home page to modify the html code? Thanks
- February 14, 2017 at 5:29 pm #8733ThemeofWPKeymaster
Hey there, thanks for using & purchased our themes! you should need to set homepage under the Settings > Reading > Homepage page as homepage.
By the way you should need to create a page named homepage with homepage template.
If you click to import demo contents xml file under the Tools > Import you’ll get full demo contents like as the demo.
You don’t need to edit any code from the theme editor.
Also you can insert this snippet into the editor area (text mode)
I hope those are clear.
Thanks,
Jenny J. - February 14, 2017 at 6:10 pm #8734filippocataniaParticipant
Dear Jenny,
my homepage is this:
<?php
get_header();$col= ‘col-md-12′;
if ( themeofwp_option(”.$shortname.’_blog_sidebar’)==’left’ || themeofwp_option(”.$shortname.’_blog_sidebar’)==’right’ ) {
$col = ‘col-md-9′;
}
?><!–/.theme-layout-start–>
<?php echo themeofwp_layout() ;?><!–/.container –>
<div class=”container-fluid”><!–/.row –>
<div class=”row”><!– sidebar left –>
<?php if(themeofwp_option(”.$shortname.’_blog_sidebar’)==’left’){ ?>
<?php get_sidebar(); ?>
<?php } ?>
<!– sidebar left –><!– #content –>
<div id=”content” class=”site-content <?php echo $col; ?>” role=”main”><!– query posts –>
<?php if ( have_posts() ) { ?>
<?php while ( have_posts() ) { the_post(); ?>
<?php get_template_part( ‘inc/post-templates/content’, get_post_format() ); ?>
<?php } ?>
<!– query posts –><!– pagination –>
<?php echo themeofwp_pagination(); ?>
<!– pagination –><?php } else { ?>
<?php get_template_part( ‘inc/post-templates/content’, ‘none’ ); ?>
<?php } ?></div>
<!– #content –><!– sidebar right –>
<?php if(themeofwp_option(”.$shortname.’_blog_sidebar’)==’right’){ ?>
<?php get_sidebar(); ?>
<?php } ?>
<!– sidebar right –></div><!–/.row –>
</div><!–/.container –>
</div><!–/.theme-layout-end–>
<?php get_footer();
I want see html code and no php. I see the code into the browser tools but they are not editable…
How to do?Sorry for my english
- February 14, 2017 at 7:41 pm #8735ThemeofWPKeymaster
You need to open header.php and inser what you want before the body and you can inser anything after the body in footer.php.
- February 14, 2017 at 8:10 pm #8736ThemeofWPKeymaster
If you want to use this snippet only home page you will need to this rule like this:
//put your code here//
-
- AuthorPosts
- You must be logged in to reply to this topic.