Tagged: post template
-
AuthorPosts
-
July 21, 2015 at 10:23 am #476372
how can I have template file for “POST”? I want to add some custom code for post (not page). How can I do that or which file should I update? single.php?
Remark: I am using child theme
July 21, 2015 at 3:56 pm #476578Hey boscotwcheung!
basically you would need to look for archive.php and single.php. For more info: https://codex.wordpress.org/Post_Type_Templates
However, I think you could achieve that with a plugin like this: https://wordpress.org/plugins/wp-custom-post-template/
Best regards,
AndyJuly 23, 2015 at 5:46 am #477491I tried to add single.php and archive.php into my child theme. However, both files didn’t loaded for post.
I also tried the custom post template plugin. I can see there is a widget title “WP Post Template” in the wp admin page. But there is nothing in it.
July 24, 2015 at 8:05 am #478060Anyone can help? Even I update the single.php in the parent theme. It doesn’t seems to be loaded at all. Which is the template file for a normal post layout?
Thanks,
AlexJuly 27, 2015 at 5:16 am #478876Hey!
Could you please provide us with a temporary admin login so that we can take a closer look? You can post the details in the Private Content section of your reply.
Regards,
RikardJuly 27, 2015 at 7:13 am #478911July 28, 2015 at 5:58 am #479429Hey!
The template for the single post page is the includes > loop-index.php file. To test it, try to remove the code inside this file then check one of the single post items. The post should be blank.
Cheers!
IsmaelJuly 30, 2015 at 4:36 am #480510No. It doesn’t work. I tried to create an empty loop-index.php into child theme and also tried to delete all the code inside loop-index.php in parent theme. Both are not working. It still shows posts content as normal.
August 2, 2015 at 5:23 am #481740Hi!
Are you using the Enfold Advanced Layout Builder in one of the Posts you are trying to modify?
Best regards,
JosueAugust 3, 2015 at 8:20 am #481933August 3, 2015 at 5:44 pm #482318Well, that explains it. ALB uses another template file (template-builder.php), what do you want to change exactly?
Regards,
JosueAugust 4, 2015 at 7:43 am #482541I want to make 2 homepage originally. One is for logged user and the other one is for visitor. I want to make a auto redirect if visitor is trying to view the logged homepage and also redirect the logged user from visitor homepage to logged homepage.
I found a plugin to add php code as a shortcode to the Enfold text element to handle this case. However, I still interested to see if I can do it in 2 template files for both homepage with the Enfold Advanced Layout editor.
August 4, 2015 at 9:40 pm #482998Hey!
You could have a version of template-builder.php in your child theme directory and modify it there.
Cheers!
JosueAugust 5, 2015 at 4:57 am #483065but I can only have one template-builder.php for all pages or posts in child theme, right?
August 5, 2015 at 7:33 am #483104Hey!
Yeah, template-builder is used for both Posts and Pages but you could make use of Conditional Tags to detect what kind of content is being shown:
https://codex.wordpress.org/Conditional_TagsBest regards,
JosueAugust 5, 2015 at 8:14 am #483123ok. I got it. Thanks!
August 5, 2015 at 8:25 am #483132You are welcome, glad to help :)
Regards,
JosueSeptember 18, 2015 at 8:14 am #505286I think this can be closed. Thanks.
-
AuthorPosts
- The topic ‘Post Template’ is closed to new replies.