-
Author
-
March 28, 2017 at 05:15 #156909wilfriedMarseilleParticipant
Hello,
I follow a tutorial to make my own template for a Custom post Type.So i need to make a new page template
( I make a question before aout it )And after i need to make a single-my-slug-ame.php
I just to replace the
get_template_part( ‘template-parts/content’, ‘pageby
get_template_part( ‘content-telechargement’ );
But i don’t find this line on the single.php from KLEO.
So what is the line than i need to change to do it.
I let you the codeIf you love Ableton check my blog :
www.zikrea.comMarch 28, 2017 at 05:16 #156910wilfriedMarseilleParticipantsingle.telechargement.php
COPY CODE<?php /** * The Template for displaying all single posts * * @package WordPress * @subpackage Kleo * @since Kleo 1.0 */ get_header(); ?> <?php //Specific class for post listing */ if ( kleo_postmeta_enabled() ) { $meta_status = ' with-meta'; if ( sq_option( 'blog_single_meta', 'left' ) == 'inline' ) { $meta_status .= ' inline-meta'; } add_filter( 'kleo_main_template_classes', create_function( '$cls','$cls .= "' . $meta_status . '"; return $cls;' ) ); } /* Related posts logic */ $related = sq_option( 'related_posts', 1 ); if ( ! is_singular('post') ) { $related = sq_option( 'related_custom_posts', 0 ); } //post setting if(get_cfield( 'related_posts') != '' ) { $related = get_cfield( 'related_posts' ); } ?> <?php get_template_part( 'page-parts/general-title-section' ); ?> <?php get_template_part( 'page-parts/general-before-wrap' );?> <?php /* Start the Loop */ ?> <?php while ( have_posts() ) : the_post(); ?> <?php get_template_part( 'content', get_post_format() ); ?> <!-- Begin Comments --> <div class="aligncenter"> <h4 class="titleComments">Une question, une remarque, un avis ?</h4> <h4>Laissez nous un commentaire.</h4> </div> <?php if ( comments_open() || get_comments_number() ) { comments_template( '', true ); } ?> <!-- End Comments --> <?php get_template_part( 'page-parts/posts-social-share' ); ?> <?php if( $related == 1 ) { get_template_part( 'page-parts/posts-related' ); } ?> <?php if ( sq_option( 'post_navigation', 1 ) == 1 ) : // Previous/next post navigation. kleo_post_nav(); endif; ?> <?php endwhile; ?> <?php get_template_part('page-parts/general-after-wrap');?> <?php get_footer(); ?>
If you love Ableton check my blog :
www.zikrea.comMarch 28, 2017 at 06:21 #156911wilfriedMarseilleParticipantSorry
In reality I just copy the single.php and i rename it with my single-slug-name.php
And i have to remake my own template directly without change this famous line.But i have a second question.
In my custom post type I put some Advanced custom Fields.
I try to show it in front end but i don’t get it.I have the <h1>Tototot</h1>
But with the
<h2><?php if (get_field(‘logiciel’)) ?></h2>
<h2><?php if (get_field(‘lien_youtube’)) ?></h2>I don’t see the field in front end.
I let you the code and the link to see the demo is :
- http://www.zikrea.com/telechargements/dgf/
COPY CODE<?php /** * The Template for displaying all single posts * * @package WordPress * @subpackage Kleo * @since Kleo 1.0 */ get_header(); ?> <?php //Specific class for post listing */ if ( kleo_postmeta_enabled() ) { $meta_status = ' with-meta'; if ( sq_option( 'blog_single_meta', 'left' ) == 'inline' ) { $meta_status .= ' inline-meta'; } add_filter( 'kleo_main_template_classes', create_function( '$cls','$cls .= "' . $meta_status . '"; return $cls;' ) ); } /* Related posts logic */ $related = sq_option( 'related_posts', 1 ); if ( ! is_singular('post') ) { $related = sq_option( 'related_custom_posts', 0 ); } //post setting if(get_cfield( 'related_posts') != '' ) { $related = get_cfield( 'related_posts' ); } ?> <?php get_template_part( 'page-parts/general-title-section' ); ?> <?php get_template_part( 'page-parts/general-before-wrap' );?> <?php /* Start the Loop */ ?> <?php while ( have_posts() ) : the_post(); ?> <?php get_template_part( 'content', get_post_format() ); ?> <h1>totopto</h1> <h2><?php if (get_field('logiciel')) ?></h2> <h2><?php if (get_field('lien_youtube')) ?></h2> <!-- Begin Comments --> <div class="aligncenter"> <h4 class="titleComments">Une question, une remarque, 3avis ?</h4> <h4>Laissez nous un commentaire.</h4> </div> <?php if ( comments_open() || get_comments_number() ) { comments_template( '', true ); } ?> <!-- End Comments --> <?php get_template_part( 'page-parts/posts-social-share' ); ?> <?php if( $related == 1 ) { get_template_part( 'page-parts/posts-related' ); } ?> <?php if ( sq_option( 'post_navigation', 1 ) == 1 ) : // Previous/next post navigation. kleo_post_nav(); endif; ?> <?php endwhile; ?> <?php get_template_part('page-parts/general-after-wrap');?> <?php get_footer(); ?>
If you love Ableton check my blog :
www.zikrea.comMarch 28, 2017 at 07:08 #156914wilfriedMarseilleParticipantSo it’s Okay
I found the good codeFor example
“<p><?php the_field(‘lien_youtube’, $term); ?></p>”But i don’t get the code to do that with a ACF from a taxonomie.
If i put that i got a 404 error page
If you love Ableton check my blog :
www.zikrea.comMarch 28, 2017 at 07:23 #156915wilfriedMarseilleParticipantMay be is because that :
( check the pic )
You can see all the pages here
If you love Ableton check my blog :
www.zikrea.comAttachments:
You must be logged in to view attached files.March 28, 2017 at 07:45 #156919wilfriedMarseilleParticipantAnd if yes i don’t find the category.php
Wich files i have to copy in my kleo child theme ?
If you love Ableton check my blog :
www.zikrea.comMarch 28, 2017 at 09:38 #156927wilfriedMarseilleParticipantSo I let you my single-telechargement.php code :
So
I got actually 2 problem
code to sho URL youtube doesn’t go but i got the block, the URL in the inspector.
But no the screen to see the video import from youtube.
this the code :COPY CODE<div> <iframe width="560" height="315" src=<?php the_field('lien_youtube', $term); ?> frameborder="0" allowfullscreen></iframe> </div>
And Always the same problem say before with the taxanomies ….
So i let you a link to see the Pages.
And i let you the script of my single-telechargement.php- http://www.zikrea.com/telechargements/exemple/
COPY CODE<?php /** * The Template for displaying all single posts * * @package WordPress * @subpackage Kleo * @since Kleo 1.0 */ get_header(); ?> <?php //Specific class for post listing */ if ( kleo_postmeta_enabled() ) { $meta_status = ' with-meta'; if ( sq_option( 'blog_single_meta', 'left' ) == 'inline' ) { $meta_status .= ' inline-meta'; } add_filter( 'kleo_main_template_classes', create_function( '$cls','$cls .= "' . $meta_status . '"; return $cls;' ) ); } /* Related posts logic */ $related = sq_option( 'related_posts', 1 ); if ( ! is_singular('post') ) { $related = sq_option( 'related_custom_posts', 0 ); } //post setting if(get_cfield( 'related_posts') != '' ) { $related = get_cfield( 'related_posts' ); } ?> <?php get_template_part( 'page-parts/general-title-section' ); ?> <?php get_template_part( 'page-parts/general-before-wrap' );?> <?php /* Start the Loop */ ?> <?php while ( have_posts() ) : the_post(); ?> <?php get_template_part( 'content', get_post_format() ); ?> <!-- Begin Disposition --> <div class ="aligncenter"> <h1><?php the_field('telechargement_titre', $term); ?></h1> <p><?php the_field('telechargements_description', $term); ?></p> <div> <iframe width="560" height="315" src=<?php the_field('lien_youtube', $term); ?> frameborder="0" allowfullscreen></iframe> </div> <!-- Les champs à afficher --> <?php //Afficher l'image $image = get_field('image'); if( !empty($image) ): ?> <img src="<?php echo $image['url']; ?>" alt="<?php echo $image['alt']; ?>" /> <?php endif; ?> </div> <!-- Begin Comments --> <div class="aligncenter"> <h4 class="titleComments">Une question, une remarque, 3avis ?</h4> <h4>Laissez nous un commentaire.</h4> </div> <?php if ( comments_open() || get_comments_number() ) { comments_template( '', true ); } ?> <!-- End Comments --> <?php get_template_part( 'page-parts/posts-social-share' ); ?> <?php if( $related == 1 ) { get_template_part( 'page-parts/posts-related' ); } ?> <?php if ( sq_option( 'post_navigation', 1 ) == 1 ) : // Previous/next post navigation. kleo_post_nav(); endif; ?> <?php endwhile; ?> <?php get_template_part('page-parts/general-after-wrap');?> <?php get_footer(); ?>
If you love Ableton check my blog :
www.zikrea.comMarch 28, 2017 at 21:36 #156975wilfriedMarseilleParticipantHi,
So it’s okay now 🙂
Thanks you
If you love Ableton check my blog :
www.zikrea.comMarch 29, 2017 at 02:53 #157008LauraModeratorHello, did you resolve it?
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionLaura Solanes - Graphic Designer and Web Designer
Please be patient as I try to answer each topic as fast as i can.
If you like the theme or the support you've received please consider leaving us a review on Themeforest!
Always happy to help you 🙂
March 29, 2017 at 12:14 #157051wilfriedMarseilleParticipantYes 🙂
If you love Ableton check my blog :
www.zikrea.comMarch 30, 2017 at 01:14 #157178LauraModeratorGlad you could resolve it 🙂
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionLaura Solanes - Graphic Designer and Web Designer
Please be patient as I try to answer each topic as fast as i can.
If you like the theme or the support you've received please consider leaving us a review on Themeforest!
Always happy to help you 🙂
-
AuthorPosts
The forum ‘General questions’ is closed to new topics and replies.