Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #292665

    Hey there, hope you´re well!

    I wanna use enfold for a new client. He´s been active in real estate sector, so I need to implement immocaster sdk into the homepage. Here you can see a small example input.

    That means I need a new template that I can use just to display different objects.

    Please can you tell me what´s the way to modify single.php to something like single-objects.php, so that I can choose the modified template just for pages where I need it? I don´t want plugin-support. I know it´s not supported.

    Thanks for reply

    Cheers

    #292681

    Hey Bruno!

    Please check this documentation on Page Templates:
    http://codex.wordpress.org/Page_Templates

    You can duplicate single.php or page.php and add a comment like this on top:

    <?php
    /*
    Template Name: My Custom Page
    */

    Regards,
    Josue

    #292866

    Hey Josue, thank you!

    Please let me ask some more question. page.php is the template to create pages (like home)? Here I can create an index-page for the different kinds of objects? I just have to change this with my own code and do some changes with css:

    <main class='template-page content  <?php avia_layout_class( 'content' ); ?> units' <?php avia_markup_helper(array('context' => 'content','post_type'=>'page'));?>>
    
                        <?php
                        /* Run the loop to output the posts.
                        * If you want to overload this in a child theme then include a file
                        * called loop-page.php and that will be used instead.
                        */
    
                        $avia_config['size'] = avia_layout_class( 'main' , false) == 'entry_without_sidebar' ? '' : 'entry_with_sidebar';
                        get_template_part( 'includes/loop', 'page' );
                        ?>
    
    				<!--end content-->
    				</main>

    To display a single-object with images eg I need to modify single.php?

    <main class='content units <?php avia_layout_class( 'content' ); ?> <?php echo avia_blog_class_string(); ?>' <?php avia_markup_helper(array('context' => 'content','post_type'=>'post'));?>>
    
                        <?php
                        /* Run the loop to output the posts.
                        * If you want to overload this in a child theme then include a file
                        * called loop-index.php and that will be used instead.
                        *
                        */
    
                            get_template_part( 'includes/loop', 'index' );
    						
                            //show related posts based on tags if there are any
                            get_template_part( 'includes/related-posts');
    
                            //wordpress function that loads the comments template "comments.php"
                            comments_template( '/includes/comments.php');
    
                        ?>
    
    				<!--end content-->
    				</main>

    Cheers
    Bruno

    #292869

    Hey!

    If you want to create a template for a custom post type just copy the single.php template to your child theme folder and rename it to single-objects.php (and replace “objects” with the custom post type name if necessary). Then modify the single-objects.php template – I recommend to replace:

    
    get_template_part( 'includes/loop', 'index' );
    

    with

    
    get_template_part( 'includes/loop', 'objects' );
    

    – this change enables you to load another, separate loop template for your custom post type.

    Then copy the wp-content/themes/enfold/includes/loop-index.php template into the child theme folder (i.e. to wp-content/themes/enfold-child/includes/ folder) and rename it to loop-objects.php. You can also modify the loop-objects.php template if necessary.

    Best regards,
    Peter

    #292917

    Hello!

    Thanks a lott to you guys..!

    Please let this topic open for a few days. I give you a message, if you can close it..

    Thanks!

    Cheers
    Bruno

    #293163

    We looking forward to hearing from you Bruno :)

    Regards,
    
Josue

    #295837

    Hey there!

    What is the best way to insert some php-phrases into page-builder?

    There is a code-box, but I think it don´t work with php?

    Best regards
    Bruno

    #295861

    Hi Bruno!

    Try using this plugin:
    https://wordpress.org/plugins/insert-php/

    Best regards,
    Josue

    #295891

    Hey Josue,

    I take a look at it.. Thank you for your tipp!

    Cheers
    Bruno

Viewing 9 posts - 1 through 9 (of 9 total)
  • The topic ‘Need to modify single.php as an own template’ is closed to new replies.