Navigation
This is archived content. Visit our new forum.
  • Author
    Posts
  • #129496

    dscuba
    Participant

    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

    #129762

    Paul R
    Moderator

    Hi,

    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

    #130076

    dscuba
    Participant

    I’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

    #130379

    Christian
    Moderator

    Hey 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.

    #130573

    dscuba
    Participant

    I 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?

    #130813

    Zeshan
    Member

    Hi 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!

    #133195

    dscuba
    Participant

    What 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

    #133274

    dscuba
    Participant
    This reply has been marked as private.
    #133324

    Nabeel A
    Moderator

    Hi 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!

    #133341

    dscuba
    Participant

    Done! Can I edit this file within WP dashboard now or do I have to do all edits within my c-panel?

    #133473

    Paul R
    Moderator

    Hi,

    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

    #136102

    dscuba
    Participant

    Hi 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(); ?>

    #136199

    Rad
    Moderator

    Hi 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!

    #136224

    dscuba
    Participant
    This reply has been marked as private.
    #136384

    Kosher K
    Member

    Hi 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