-
AuthorPosts
-
November 11, 2014 at 12:26 pm #142647
Hi, I’m having an issue with category posts. I have a category link in my menu that takes you to a category post page and it’s only displaying an excerpt of the post, with no images and I need it to display the full post. I’ve been looking through all the fixes on google and the forum and none of them seem to apply. ie. changing category.php or archive.php from excerpt to full content.
Is there some easy fix for this that I’m overlooking? Doesn’t seem like it should be so difficult.
November 12, 2014 at 2:50 am #143117Hi Michelle,
Thanks for writing in!
You can set it under Blog > Content in the customizer.
http://screencast.com/t/MZa3FdBaTv
Hope that helps.
November 12, 2014 at 1:27 pm #143603This reply has been marked as private.November 12, 2014 at 11:54 pm #144004Hi Michelle,
Because this requires a template change, Iβd advise that you setup a child theme. This allows you to make code changes that wonβt be overwritten when an X update is released. After your child theme is setup, please review how we recommend making template changes in Customization Best Practices.
Then create file _content.php in wp-content\themes\x-child-renew\framework\views\global
then copy the code below into that file.<?php // ============================================================================= // VIEWS/GLOBAL/_CONTENT.PHP // ----------------------------------------------------------------------------- // Display of the_excerpt() or the_content() for various entries. // ============================================================================= $stack = x_get_stack(); $is_full_post_content_blog = (is_home() || is_archive()) && x_get_option( 'x_blog_enable_full_post_content', '' ) == '1'; ?> <?php if ( is_singular() || $is_full_post_content_blog ) : x_get_view( 'global', '_content', 'the-content' ); if ( $stack == 'renew' ) : x_get_view( 'renew', '_content', 'post-footer' ); endif; else : x_get_view( 'global', '_content', 'the-excerpt' ); endif; ?>
Hope that helps. π
November 13, 2014 at 12:01 pm #144466Got it! Worked perfectly. Thanks very much!
November 13, 2014 at 9:29 pm #144833Cool, that’s great! You’re so much welcome Michelle!
June 3, 2015 at 8:40 pm #291919Hello – I need to do this for just a certain category – so that that category archive page will display full posts. I understanding need to create a specific category page – such as category-134.php
But I need to know what code I use in this page.. and does this page go in the root of my child theme folder? Or in “global” folder?Also – if I do this, can I turn on pagination for this page. EG – it shows 4 posts per page and then paginates beyond that?
Thanks so much
June 4, 2015 at 2:58 am #292250Hello There,
Thanks for updating the thread! You can set the category archive page in your customizer, Appearance > Customize > Blog > Archives > Layout. The default number of post per page can be set in the settings, Settings > Reading Settings > Blog pages show at most.
To assist you with this issue, we’ll first need you to provide us with your URL. This is to ensure that we can provide you with a tailored answer to your situation. Once you have provided us with your URL, we will be happy to assist you with everything.
Thank you.
June 4, 2015 at 7:53 pm #293007Thanks! I don’t think I was quite clear though sorry.. I realise we can make global changes in those two places.. but what I am needing is to make changes to just a certain specific category – I understand can make a category page by making file: category-ID.php – BUT I am not sure what to code to use in this file.
For example this is the site here: http://27.121.66.4/~abab6919/wordpress/
the main section is SERVICES – I am using MASONRY layout to display the archive pages for the various service categories- and have manually added code to add the EXCERPT below each featured image.. this all works fine .. BUT what about when we need to make just a specific category behave differently .. EG, I have a category TESTIMONIALS – and for this section it is just small tet entries, sometimes a pic., but no featured image required … so I want its category archive page to display all the posts at once, as full posts, ideally with a set number of posts at a time, say 6, and then pagination to activate.I realise I can do this kind of thing with a plugin on a specific page and I am able to successfully do this (except for a pagination issue as described below) BUT since I have the “Select Category” category list widget on the sidebar – users are still going to be able to access this category through that method and it needs to look correct when they do this. .
SO – My optiomsm are:
1.
to manually make that category template page display differently to the standard MASONRY that I have set globally – please advise how to do this .. I realise I need to make the category-ID,php page- but not sure what code to use.OR
2.
to remove “Testimonials” from the “Select Category” list widget- it is not possible to remove a category from this list in the WIDGET settings or the customiser – but is but is there another way through code to do this? – please advise how to do this.(Because for future reference and other clients I need to know how to achieve both these solutions)
PLUGIN PAGINATION ISSUE – In terms of displaying all the posts of a certain category into page I realise that plugins can do this .. and I have been able to almost achieve a great result using the plugin ‘List Category Posts’ pls see example page here: http://27.121.66.4/~abab6919/wordpress/?page_id=7493
It is working except that X THEME seems to break the pagination at I am not sure why – but it is detecting the right umber of pagination page icons required – but when they are clicked on they don’t go anywhere .. I know that you are not able to do plugin support – but since the plugin does work except for the pagination I thought I would ask in case you had any ideas of a setting I can change to fix this..Thanks so much, you support is amazing – I think most if not all of my future sites for clients will be built on X
June 4, 2015 at 9:29 pm #293086UPDATED: Using CSS I was able to control what I can show/hide in the Categories list sidebar .. I used this:
#cat.postform option.level-0 {
display:none !important;
}level-0 being the top level categories – so it only shows my categories in the list of they are subcategories – this is a workaround and useful to be abel to do .. BUT, I was trying to use CSS to control just one specific category in the list, and make that disappear and I tried to do it but using [value=”134″], IE:
#cat.postform option [value=”134″] {
display:none !important;
}but it didn’t work, I was only able to control it usiing CLASS level-o … I suspect I SHOULD be abel to do this, but i was using [value=”134″] wrong .. can you please advise what I did wrong here?
ThxJune 5, 2015 at 4:46 pm #293843Hi there,
With that kind of customization, I think css alone is weak implementation. Why not try you first option? Creating category based template (eg. category-ID.php) ?
It’s simple, just duplicate /x/index.php and rename the duplicate as /x-child/category-1289.php
Then just follow the code x_get_view() , the template parts it calls are located at /x/framework/views/ which of course grouped by stack or global. Now duplicate your template parts too change x_get_view() as per template change. Again, do this at your child theme.
You don’t need to duplicate all template parts, just duplicate the one you wish to edit. For example, you wish to disable masonry for category-1289.php ? Then duplicate /x/framework/views/global/_index.php to something like /x/framework/views/global/_category1289.php
Then force standard style by changing its code from :
if ( is_home() ) : $style = x_get_option( 'x_blog_style', 'standard' ); $cols = x_get_option( 'x_blog_masonry_columns', '2' ); $condition = is_home() && $style == 'masonry'; elseif ( is_archive() ) : $style = x_get_option( 'x_archive_style', 'standard' ); $cols = x_get_option( 'x_archive_masonry_columns', '2' ); $condition = is_archive() && $style == 'masonry'; elseif ( is_search() ) : $condition = false; endif;
to this :
if ( is_archive() ) : $style = 'standard'; $cols = x_get_option( 'x_archive_masonry_columns', '2' ); $condition = is_archive() && $style == 'masonry'; elseif ( is_search() ) : $condition = false; endif;
Because of the change above, you will have to duplicate /x/framework/views/{YOUR SELECTED STACK}/wp-index.php to something like /x/framework/views/{YOUR SELECTED STACK}/wp-category1289.php and change its coding from :
<?php x_get_view( 'global', '_index' ); ?>
to this :
<?php x_get_view( ‘global’, ‘_category1289’ ); ?>
Then again, because of the change from /x/framework/views/{YOUR SELECTED STACK}/wp-category1289.php, you have to change your /x-child/category-1289.php coding too from :
<?php x_get_view( x_get_stack(), 'wp', 'index' ); ?>
to :
<?php x_get_view( x_get_stack(), 'wp', 'category1289' ); ?>
————–
As you can see, it requires changes depending on the template chain. Once you rename a template part, you will have to update its caller too.
Hope this helps π
June 5, 2015 at 10:27 pm #294062Thanks so much – this is the exact detail I needed
June 5, 2015 at 10:57 pm #294083Just one thing not covered in your answer.. .. the pagination plugin issue.. but I will start another thread for that π Thx
June 6, 2015 at 9:14 pm #294663Thanks. We’ll get you there.
June 17, 2015 at 6:56 pm #305439You guys are sooo awesome! π
-
AuthorPosts