-
Author
-
July 22, 2015 at 14:50 #69436wilfriedMarseilleParticipant
Hello.
I try to understand how to add a post layout to customise my articles. But i don’t know how to do that …If you love Ableton check my blog :
www.zikrea.comJuly 22, 2015 at 15:06 #69444sharmstrModeratorYou have two options
1 – Enable visual composer for posts. If you do that, you may want to turn off ‘display media on posts’. You’ll also have to use custom posts excerpts.
2 – If you know php and wordpress templating, you can edit the template files.
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
July 22, 2015 at 16:00 #69454wilfriedMarseilleParticipantYes i know php and wordpress templating. I’m gone in KLEO > Page Template and i add a ful-with2.php
I can select it for page but no for articles.
Where is the folder with article template please ?If you love Ableton check my blog :
www.zikrea.comJuly 22, 2015 at 16:13 #69455sharmstrModeratorThere’s not just one file. They are broken up into several files depending on what layout AND post format you have selected.
Put this in your child theme functions.php file. It will put comments in your page source code that will tell you which template files are being called.
COPY CODE/** * show included template files */ add_action('all','template_snoop'); function template_snoop(){ $args = func_get_args(); if( !is_admin() and $args[0] ){ if( $args[0] == 'template_include' ) { echo "<!-- Base Template: {$args[1]} -->\n"; } elseif( strpos($args[0],'get_template_part_') === 0 ) { global $last_template_snoop; if( $last_template_snoop ) echo "\n\n<!-- End Template Part: {$last_template_snoop} -->"; $tpl = rtrim(join('-', array_slice($args,1)),'-').'.php'; echo "\n<!-- Template Part: {$tpl} -->\n\n"; $last_template_snoop = $tpl; } } }
Just view the page source and search for “Template Part” to see all the template files the page has called. See attached example
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
Attachments:
You must be logged in to view attached files.July 22, 2015 at 16:34 #69463wilfriedMarseilleParticipantI have to check this tomorrow because i have to go Work.
Thanks you 🙂If you love Ableton check my blog :
www.zikrea.comJuly 22, 2015 at 16:36 #69464wilfriedMarseilleParticipantAnd how we enable visual composer for post ?
If you love Ableton check my blog :
www.zikrea.comJuly 22, 2015 at 16:41 #69467sharmstrModeratorVisual Composer > General Settings
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
July 22, 2015 at 17:18 #69474wilfriedMarseilleParticipantVery good support !!!! The 25 of month i got my money i’m not super rich but i would like give a little donnation of 10$ because you are a great team. It’s a plesaure to develop project with you. I have to go out now. I’m going to search the donation button the 25 but if you got a link is better :).
Thanks you.O and I did’nt make my article template. But when I will make it. Can I save it in the Post Layout ? If yes how we do that ?
Thanks again 🙂If you love Ableton check my blog :
www.zikrea.comJuly 22, 2015 at 17:54 #69480wilfriedMarseilleParticipantSo i put the visual composer for post an article.
But in reality my problem is already here because i want change the place of authors meta data, i don’t want see all the information but just the name, add a button like / Disslike or a star notation systeme.
And with the visual composer i see only the text edit, no the others parts like social share …So if i have understand I have to edit a template files with PHP. And to do this I have to edit more than 1 files because it use template part ?
But i don’t understand wich files i have to create to make a post template.If you love Ableton check my blog :
www.zikrea.comJuly 23, 2015 at 13:58 #69609sharmstrModeratorAs I mentioned before, add the code I gave you. It will tell you which pages you need to either change or copy and customize.
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
July 23, 2015 at 14:05 #69615sharmstrModeratorYou can also look at single.php. That’s the template that’s used for posts. You’ll see in there the other templates that are used to build the page. For example, just before the loop it calls out one of the content templates depending on the post format that has been selected. Lets say it was an image post. Then you’d open up content-image.php.
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
July 28, 2015 at 11:50 #70352wilfriedMarseilleParticipantHello
When I put you code in the child KELO > function.php I get an error when a refresh my page :Parse error: syntax error, unexpected ‘}’ in /homepages/3/d556184796/htdocs/le-journal-des-dj-producteurs/wordpress/wp-content/themes/kleo-child/functions.php on line 33
If you love Ableton check my blog :
www.zikrea.comJuly 28, 2015 at 12:27 #70364wilfriedMarseilleParticipantSorry it’s an error of Me …
But I put the code `/**
* show included template files
*/
add_action(‘all’,’template_snoop’);
function template_snoop(){
$args = func_get_args();
if( !is_admin() and $args[0] ){
if( $args[0] == ‘template_include’ ) {
echo “<!– Base Template: {$args[1]} –>\n”;
} elseif( strpos($args[0],’get_template_part_’) === 0 ) {
global $last_template_snoop;
if( $last_template_snoop )
echo “\n\n<!– End Template Part: {$last_template_snoop} –>”;
$tpl = rtrim(join(‘-‘, array_slice($args,1)),’-‘).’.php’;
echo “\n<!– Template Part: {$tpl} –>\n\n”;
$last_template_snoop = $tpl;
}
}
}`
And when i look the source code, the template parrts are not inside.If you love Ableton check my blog :
www.zikrea.comJuly 28, 2015 at 13:34 #70378sharmstrModeratorYou have fancy quotes in your code. Copy my code again, making sure the single and double quotes dont change.
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
July 28, 2015 at 13:38 #70379sharmstrModeratorLooks like there is a new plugin that basically does the same thing. I havent tried it https://wordpress.org/plugins/show-current-template/screenshots/
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
July 28, 2015 at 15:14 #70397wilfriedMarseilleParticipantthanks you with the plug in it’s great 🙂
If you love Ableton check my blog :
www.zikrea.comJuly 28, 2015 at 15:20 #70398wilfriedMarseilleParticipantAnd is possible to make a article second.php to get a second type of post. With some differents. And choose the second template in the post layout of the dashboard ?
If you love Ableton check my blog :
www.zikrea.comJuly 28, 2015 at 15:25 #70399sharmstrModeratorI thought you said you know wordpress templating? To answer your question, yes you can.
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
July 28, 2015 at 15:38 #70401wilfriedMarseilleParticipantYes I know WordPress templating but, page template, no post layout template …
If you love Ableton check my blog :
www.zikrea.comJuly 28, 2015 at 15:42 #70404sharmstrModeratorThey work the same. Google it.
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
-
AuthorPosts
The forum ‘KLEO’ is closed to new topics and replies.