-
AuthorPosts
-
February 22, 2015 at 12:37 pm #212344
Hello, I’m trying to custom theme one of my category pages like the one in the link below. I’d like this category page to show me full blog posts in the body of the page, have different content on the side bar than what I have for the rest of the site, and I’d like to have a slideshow/slider above the main content area.
http://yuppiesinparadise.com/travel-blog/category/all/travel/culture/
Can you point me in the right direction? I already have a child theme set up.
February 22, 2015 at 12:39 pm #212345I tried to relate this generic wordpress information:
http://codex.wordpress.org/Category_Templates
To the X theme and could not figure out the relationship.
February 22, 2015 at 12:41 pm #212347Or alternatively if I can do this with a page instead of a customization of the category page then that would actually work better.
February 22, 2015 at 9:08 pm #212577Hi Sally,
You can still follow http://codex.wordpress.org/Category_Templates , It never changed on X. Though X uses additional structure for calling template parts.
All post, category, tags, search, and etc. are all using the same template, it’s index.php. You can duplicate index.php and rename it to category page. Then apply your customization to that duplicate just as long as you followed X’s template part structure.
Eg. you can use x_get_view() and place your template parts at /framework/views/{STACK}/
index.php is the base of all, if a template is not available, then wordpress will use it. So all you have to do is create or duplicate your own template.
You can check existing templates as a sample 🙂
More here https://theme.co/x/member/kb/customization-best-practices/
Cheers!
February 25, 2015 at 11:50 pm #215583Ok thank you for your help in getting me started here. I’ve made great progress, which can be seen on the below page. I’ve created custom template files to create a new header for this category. I’ve also modified the code to load the full text of each blog post and modified the CSS to make sure it looks consistent with the rest of my site:
http://yuppiesinparadise.com/travel-blog/category/pacific-crest-trail-journal/
My next aim is to include the “comments” area and the “This post ain’t gonna share itself” area at the bottom of each post. These do not get loaded in the above link, but they do get loaded on single posts, for example:
http://yuppiesinparadise.com/travel-blog/pacific-crest-trail-thru-hike-announcement/
I believe I can figure out how to do this if you help me trace what exactly the following two functions are doing inside of global/_content-the-content.php:
<?php x_link_pages(); ?> <?php do_action( 'x_before_the_content_end' ); ?>
Or if you can point me to the location of these functions?
Thank you!
February 26, 2015 at 10:08 am #215841Hi Sally,
The first line is a function that calls WordPress native function wp_link_pages() and is defined in file “/themes/x/framework/functions/global/content.php”.
The second line is X specific Action, you can review it here: https://theme.co/x/member/kb/customization/actions-and-filters-in-x/
Thank you.
February 26, 2015 at 10:31 pm #216315Ok, but where is the code located that gets processed after you call the “x_before_the_content_end” action? I’m trying to figure out exactly what this action does, but I’m having trouble locating it in the various function files of the theme.
Thank you!
February 27, 2015 at 10:15 am #216660Hi Sally,
First, I’d advise you learning about WordPress hooks here: http://codex.wordpress.org/Plugin_API/Action_Reference. x_before_the_content_end is a action, it is only used when you need to add something in that place of your website. We’ve a detailed article on how to use actions and filters in X, please review it here: https://theme.co/x/member/kb/customization/actions-and-filters-in-x/
Thank you.
February 27, 2015 at 2:34 pm #216821Yes, I think I got that, but where is the code for the action located? This is an action that x created right? So there is some code associated with it? https://theme.co/x/member/kb/customization/actions-and-filters-in-x/ only tells me where the action gets called, but not the code that gets executed once the action gets called.
Also, perhaps I’m going down the wrong path…if you look at the post that I posted on February 25, 2015 at 11:50 pm:
Ok thank you for your help in getting me started here. I’ve made great progress, which can be seen on the below page. I’ve created custom template files to create a new header for this category. I’ve also modified the code to load the full text of each blog post and modified the CSS to make sure it looks consistent with the rest of my site: http://yuppiesinparadise.com/travel-blog/category/pacific-crest-trail-journal/ My next aim is to include the “comments” area and the “This post ain’t gonna share itself” area at the bottom of each post. These do not get loaded in the above link, but they do get loaded on single posts, for example: http://yuppiesinparadise.com/travel-blog/pacific-crest-trail-thru-hike-announcement/
Based on how the code is executed I believe the “x_before_the_content_end” action is adding the comments section and social media icons to the bottoms of single articles. What I’m trying to do is to create my own action that also adds this same content to the bottom of each post in my category feed. That is why I am looking for the location of the actual code. If this is wrong, then can you point me to the code in the template that is appending the comments to the bottom of single page posts such as this one here:
http://yuppiesinparadise.com/travel-blog/pacific-crest-trail-thru-hike-announcement/
So that I can figure out how to code in the ability to do that for my category feed here:
http://yuppiesinparadise.com/travel-blog/category/pacific-crest-trail-journal/
Please let me know if this is not clear. Thank you!
February 28, 2015 at 3:23 pm #217351Hi there,
This is a single post page http://yuppiesinparadise.com/travel-blog/pacific-crest-trail-thru-hike-announcement/ which is normally have comment. It does not need a filter or action, because comments are directly embedded to single post template.
This one http://yuppiesinparadise.com/travel-blog/category/pacific-crest-trail-journal/ is an archive page (category), it displays multiple posts and you can’t have comment section on that. Comment should be link to its post’s ID, and archive page does not have ID since it displays multiple posts. Archive page is non-existing page compared to posts, page, portfolio. It uses archive template and you can add code for comment but it will not work.
Thanks!
March 3, 2015 at 9:29 am #219311
AnonymousHi Sally, thanks for bringing this up! This helped me too. 🙂
March 3, 2015 at 2:51 pm #219519Glad we could help.
Cheers!
-
AuthorPosts