-
AuthorPosts
-
October 21, 2014 at 4:09 pm #129496
Hi X,
I want to create a Post Template that I can use each time I create and add content to my site. How do I set this up?
The Post template will have consistent locations (containers?) for Adsense, Facebook Buttons, etc. that I’d like within the content section…not just the sidebar.
I can provide an example if needed.
Thank You for the great support of your awesome theme,
Espressoulcafe.com
October 22, 2014 at 3:13 am #129762Hi,
Thanks for writing in!
You’ll need to set up a child theme first then put your custom template in the child theme directory.
It will override the default xtheme template.Here is how to set-up a child theme.
http://theme.co/x/member/kb/how-to-setup-child-themes/
Hope that helps
October 22, 2014 at 1:00 pm #130076I’m already working in the child theme for Ethos. My question is:
I want to create a Post Template that I can use each time I create and add content to my site. How do I set this up?
How do I create a Post template from scratch and what exact child theme directory do I place it in?
Lastly, will this effect the Format selections when adding a new Post?
Thank you
October 22, 2014 at 11:13 pm #130379Hey there,
We’d love to help you with your concern however, our support does not cover template creation. We recommend that you modify a post template not create your own unless you’re comfortable with WordPress development or you have someone who knows it. Please see http://theme.co/x/member/kb/customization-best-practices/ on how to customize X.
Thank you for understanding.
October 23, 2014 at 5:55 am #130573I understand and have read the link above. Do I have to modify the post template each time I want to create a post by adding the exact same elements or is there a simpler way to “Save As” the template for continuous usage?
The only work around I know is to build a Post with the layout I’m looking for and each time I want to add a new Post, cut and paste all the code into the new Post. Wondering if there is a simpler way?
October 23, 2014 at 10:51 am #130813Hi there,
No, you can simply modify the existing template files using a child theme for posts. And you won’t have to cut and paste the code each time. However as mentioned above, this customization will fall beyond the scope of support we can provide. You may wish to consult a developer, or a service like WerkPress or Elto to assist you with this. X is quite extensible with child themes, so there are plenty of possibilities.
Thanks for understanding. Take care!
October 27, 2014 at 1:50 pm #133195What is the name of the POST Template file and what directory is it under? I searched all files where I thought it would be.
This folder as well as the global are both empty.
public_html/wp-content/themes/x-child-ethos/framework/views/ethos
October 27, 2014 at 2:54 pm #133274This reply has been marked as private.October 27, 2014 at 4:15 pm #133324Hi again,
The child theme directories are empty by default, you’ll need to copy the file from the parent directory and paste in the child theme for editing. To edit the post page template, you’ll need to copy wp-content/themes/x/framework/views/ethos/wp-single.php and paste in the child theme’s framework/views/ethos/ directory.
Let us know if this helps!
October 27, 2014 at 4:39 pm #133341Done! Can I edit this file within WP dashboard now or do I have to do all edits within my c-panel?
October 28, 2014 at 12:26 am #133473Hi,
The best way is to download an ftp client here http://lifehacker.com/5039956/five-best-ftp-clients.
(Select one)Login to ftp using your cpanel credentials.
Then navigate to your theme files wp-content/themes/x-child-ethos/framework/views/ethos/
and download the file wp-single.php, edit the downloaded file and upload it back again.Hope that helps
October 31, 2014 at 2:50 pm #136102Hi Team X,
Your last reply is confusing. Not sure why I would need to download an FTP client when my question was concerning where to edit the POST Template (wp-single.php) that I copied into my child theme. My cpanel has a built in editor so I assume I can just add code there and save…correct?
If so, I added this shortcode (see below) [share title=”Social” facebook=”true”] and it simply added this code to all my posts below the comments box. See http://www.espressoulcafe.com/inspirational-postgame-interview-goes-viral/
<?php
// =============================================================================
// VIEWS/ETHOS/WP-SINGLE.PHP
// —————————————————————————–
// Single post output for Ethos.
// =============================================================================$fullwidth = get_post_meta( get_the_ID(), ‘_x_post_layout’, true );
?>
<?php get_header(); ?>
<div class=”x-container-fluid max width main”>
<div class=”offset cf”>
<div class=”<?php x_main_content_class(); ?>” role=”main”><?php while ( have_posts() ) : the_post(); ?>
<?php x_get_view( ‘ethos’, ‘content’, get_post_format() ); ?>
<?php x_get_view( ‘global’, ‘_comments-template’ ); ?>
<?php endwhile; ?>[share title=”Social” facebook=”true”]
</div>
<?php if ( $fullwidth != ‘on’ ) : ?>
<?php get_sidebar(); ?>
<?php endif; ?></div>
</div><?php get_footer(); ?>
October 31, 2014 at 5:50 pm #136199Hi there,
Yes, file manager is okay.
And about the shortcode, it should be like this
<?php echo do_shortcode('[share title="Social" facebook="true"]'); ?>
It is automatic on editor’s content, but not on template. So you have to manually execute like that.
Thanks!
October 31, 2014 at 6:57 pm #136224This reply has been marked as private.November 1, 2014 at 7:28 am #136384Hi There,
Sorry for the confusion,
To clarify, you don’t necessarily need to connect via FTP or download and use any editor to edit a php file.
Your goal is to edit and copy this file on your child theme wp-content/themes/x/framework/views/ethos/wp-single.php
So it needs to be in here wp-content/themes/x-child-ethos/framework/views/ethos/wp-single.php and you can either use FTP, or if you are using cpanel, you can use its built-in cpanel editor, or you can even use wordpress plugin like wp editor. It doesn’t matter, as long as you can able to edit that file and add the code you needed,
Wordpress Post uses the file wp-single.php so that’s where you should add your code.
And No, Post Doesn’t support optional template unlike page, you cannot have different template in a post,
Hope this clarifies,
Have a great day
-
AuthorPosts