Tagged: x
-
AuthorPosts
-
June 9, 2016 at 7:12 pm #1034841
lexidevParticipantI have the code which seems to work and have placed it in various different child theme files within the Renew view. Found an old post that adds the description below the category archive title, but that pushes the page down and allows only for a few words. The code I have is:
<p class="cat-desc"><?php echo category_description(); ?></p>It works, but I need to know how to place it so that it is displayed above the tiled posts, within the content wrapper in that category archive. Please see the screen print.
Please advise.
June 10, 2016 at 12:44 am #1035349
LelyModeratorHi There,
Thank you for the screenshot. We can add it on content.php file. Copy content.php from wp-content/themes/x/framework/views/renew to this folder wp-content/themes/x-child/framework/views/renew. Open the copied file and replace the code with the following:
<?php // ============================================================================= // VIEWS/RENEW/CONTENT.PHP // ----------------------------------------------------------------------------- // Standard post output for Renew. // ============================================================================= ?> <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <div class="entry-wrap"> <?php if(is_category()): ?> <p class="cat-desc"><?php echo category_description(); ?></p> <?php endif; ?> <?php x_get_view( 'renew', '_content', 'post-header' ); ?> <?php if ( has_post_thumbnail() ) : ?> <div class="entry-featured"> <?php x_featured_image(); ?> </div> <?php endif; ?> <?php x_get_view( 'global', '_content' ); ?> </div> </article>You can see that we have added the following code after entry-wrap:
<?php if(is_category()): ?> <p class="cat-desc"><?php echo category_description(); ?></p> <?php endif; ?>Hope this helps.
June 10, 2016 at 5:40 pm #1036530
lexidevParticipantThanks for the code, but it doesn’t help. It puts the category description above every post title in the category archive, see attached. I tried tacking it on to the _landmark_header.php and various other places, but the category description repeats every time as many times as there are posts on the archive page, even if I place a div after the posts and outside the ‘article id=”post-…’ element.
Any other ideas?
June 10, 2016 at 11:30 pm #1036916
DarshanaModeratorHi there,
Please provide us with the URL to your sample category description page, so that we can assist you with a possible workaround in your situation.
Thanks!
June 11, 2016 at 1:56 pm #1037540
lexidevParticipantHere is the page. But the solution should work for all categories. Actually having category descriptions available would work for many of my sites, and for this particular site especially. http://www.goodmaninstitute.org/topics/health-reform-bill/
The category archive .x-iso-container is governed by a script and overlays .x-main .left. So all text I put into the latter is covered by the post excerpts. What I would like to see is the description pushing down only the masonary posts and not also the sidebar.
I would imagine that you can test your code suggestions in any renew stack setup with masonery archive display. Any help with this is welcome, thanks.
June 11, 2016 at 11:10 pm #1037877
RadModeratorHi there,
Instead of editing the content.php, you should edit _index.php from \wp-content\themes\x\framework\views\global\
Then add this code
<?php if(is_category()): ?> <p class="cat-desc"><?php echo category_description(); ?></p> <?php endif; ?>before this line of code,
<?php x_get_view( 'global', '_script', 'isotope-index' ); ?>Hope that helps.
June 15, 2016 at 1:19 pm #1043691
lexidevParticipantThank you Rad. This worked. I’ve added the plugin “HTML in Category Descriptions” and if you wrap your text carefully into a div that you style yourself you can format the text nicely. Need to know css and html code. Very, very nice addition to the Theme this bit of code. My client and I am thrilled!
June 15, 2016 at 1:33 pm #1043724
RahulModeratorYou are most welcome! Let us know if you need any further help and we’ll be happy to assist.
Thanks
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1034841 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
