-
AuthorPosts
-
July 17, 2014 at 10:25 pm #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
July 17, 2014 at 10:43 pm #292681Hey Bruno!
Please check this documentation on Page Templates:
http://codex.wordpress.org/Page_TemplatesYou can duplicate single.php or page.php and add a comment like this on top:
<?php /* Template Name: My Custom Page */
Regards,
JosueJuly 18, 2014 at 7:49 am #292866Hey 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
BrunoJuly 18, 2014 at 8:12 am #292869Hey!
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,
PeterJuly 18, 2014 at 12:21 pm #292917Hello!
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
BrunoJuly 18, 2014 at 10:31 pm #293163We looking forward to hearing from you Bruno :)
Regards,
JosueJuly 25, 2014 at 10:10 am #295837Hey 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
BrunoJuly 25, 2014 at 10:52 am #295861July 25, 2014 at 12:22 pm #295891Hey Josue,
I take a look at it.. Thank you for your tipp!
Cheers
Bruno -
AuthorPosts
- The topic ‘Need to modify single.php as an own template’ is closed to new replies.