WordPress.org

Ready to get started?Download WordPress

Forums

Allow HTML in Category Descriptions
[resolved] how to display the catgory description (8 posts)

  1. kranthika
    Member
    Posted 1 year ago #

    i have installed the plugin and able to add the html description

    but unable to display the description i have used this code <?php
    $args=array(
    'orderby' => 'name',
    'order' => 'ASC'
    );
    $categories=get_categories($args);
    foreach($categories as $category) {
    echo '<p> Description:'. $category->description . '</p>';
    }
    ?>

    but unable to display the description plz help me its urgent

    http://wordpress.org/extend/plugins/allow-html-in-category-descriptions/

  2. Arno Esterhuizen
    Member
    Plugin Author

    Posted 1 year ago #

    Hi, Kranthika

    This isn't directly related to the plugin, but I can try and help.

    According to the codex, that is the right code to use to access the category descriptions. Can you put a var_export($categories) after $categories=get_categories($args); and paste the results here?

    Thanks
    Arno

  3. mediabaron3000
    Member
    Posted 7 months ago #

    Hi Arno,

    Ive installed your plugin and got copy on the category page but it does not display.....is this the theme itself ?

    My categories.php files looks like this.

    <?php get_header(); ?>
    
    <div id="main">
    
    	<div id="post-area">
    
    		<div class="breadcrumb">
    
    			<?php if (function_exists('dimox_breadcrumbs')) dimox_breadcrumbs(); ?>
    
    		</div>
    
    		<h1 class="page-header headline"><?php single_cat_title(); ?></h1>
    
    		<ul class="recent">
    
    		<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    
    			<li>
    
    			<?php if (  (function_exists('has_post_thumbnail')) && (has_post_thumbnail())  ) { /* if post has a thumbnail */ ?>
    
    			<div class="home-story-cat">
    
    				<div class="img-contain">
    
    					<a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title(); ?>" class="img-shadow"><?php the_post_thumbnail('small-thumb'); ?></a>
    
    				</div><!--img-contain-->
    
    				<div class="story-text">
    
    					<h2><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h2>
    
    					<p><?php echo excerpt(32); ?></p>
    
    				</div><!--story-text-->
    
    			</div><!--home-story-cat-->
    
    			<?php } else { ?>
    
    			<div class="home-story-cat">
    
    				<div class="story-text-noimg">
    
    					<div class="cat-small"><?php the_category(); ?></div>
    
    					<h2><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h2>
    
    					<p><?php echo excerpt(32); ?></p>
    
    				</div><!--story-text-->
    
    			</div>
    
    			<?php } ?>
    
    			</li>
    
    		<?php endwhile; endif; ?>
    
    		</ul>
    
    		<?php posts_nav_link(' — ', __('&laquo; Previous Page'), __('Next Page &raquo;')); ?>
    
    	</div><!--post-area-->
    
    </div><!--main -->
    
    <?php get_sidebar(); ?>
    
    <?php get_footer(); ?>

    Thanks heaps!

  4. Arno Esterhuizen
    Member
    Plugin Author

    Posted 7 months ago #

    Hi, mediabaron3000

    I don't see your theme using the "category_description" function, which would display the category description.

    Try that and let me know, or create a new issue.

    Cheers
    Arno

  5. mediabaron3000
    Member
    Posted 7 months ago #

    Hi Arno,

    Thanks for the reply. Unfortunately I don't know how to use this function. My coding is not great.

    Can I just paste `function sb_allow_category_desc_html() {
    foreach ( array( 'pre_term_description', 'pre_link_description', 'pre_link_notes', 'pre_user_description' ) as $filter ) {
    remove_filter( $filter, 'wp_filter_kses' );
    }
    foreach ( array( 'term_description', 'link_description', 'link_notes', 'user_description' ) as $filter ) {
    remove_filter( $filter, 'wp_kses_data' );
    }
    }
    add_action( 'init', 'sb_allow_category_desc_html' );`

    into my functions.php file. (copied from your review page).

    Failing that, is that something you could help me with ?

    Thanks very much Arno

  6. Arno Esterhuizen
    Member
    Plugin Author

    Posted 7 months ago #

    Hi, mediabaron3000

    Unfortunately adding that code wouldn't help. Contact the theme creator and ask them to add the category descriptions to the theme.

    This plugin will then kick in and render the description in HTML.

    Cheers
    Arno

  7. mediabaron3000
    Member
    Posted 7 months ago #

    Thanks Arno,

    I already tried that but he said he was unable to help :(

    Sucks because its a really a great feature. Im happy to pay for sometimes time.

    Thanks anyway.

  8. Arno Esterhuizen
    Member
    Plugin Author

    Posted 7 months ago #

    Hi, mediabaron3000

    Can you email me a zipped copy of your theme to arno.esterhuizen+wordpress-plugins@gmail.com? I can then see what needs to be done and send you a quote.

    Cheers
    Arno

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.