• Hi,

    I have looked up some code from the codex on how to create static info above the posts within a category.

    I thought I did everything right, but apparantly not.
    Have a look at terrorkids . nl to see what I mean.

    Maybe I should explain what I want to achieve
    I want to have menu’s with categories. And then, when you click on one of the menu items, I want to display – preferably – a page with general info about the categorie. And then below that info either a link (like: go to all articles within category A) or all articles within that category. My problemn description is about one way to my goal.

Viewing 7 replies - 1 through 7 (of 7 total)
  • to try this thing
    1. activate twentyten theme.
    2. fill in category’s Description
    3. check the category page

    then
    create child theme https://codex.www.ads-software.com/Child_Themes

    Thread Starter hb2011

    (@hb2011)

    Hmmm, I didn’t mention that I use Atahualpa and I love it. So, activating twentyten is not my desired option.

    just to make it easier to understand.
    you can change back later.

    nevermind,
    1. open index.php of atahualpa
    add this code at line 15

    <?php $tdDesc = category_description(); if ( ! empty( $tdDesc ) ) echo '<div class="archive-desc">'.$tdDesc.'</div>'; ?>

    before
    <?php while (have_posts()) : the_post(); $bfa_ata['postcount']++; ?>

    2. fill in category’s Description
    3. check the category page

    Thread Starter hb2011

    (@hb2011)

    Ok thanks very much, but it doesn’t work. I probably make some little mistake in either my adjustment to category.php and/or index.php.

    I tried to include it in index.php as you wrote. I deleted my original code from the category.php. But the result is now a blank page. If I add the original change to category.php again, I have the old line back. On a blank page.

    So now I reverted to my original change to category.php and no change to index.php. This to make sure my testpage is there to see for everybody at terrorkids . nl – including the origional change to category.php.

    Also, I wonder why you have chosen to use category description, instead of category name. Is there a reason for this?

    The code looks as follows:

    <?php $tdDesc =this is a description of the category apples(); if ( ! empty( $tdDesc ) ) echo ‘<div class=”archive-desc”>’.$tdDesc.'</div>’; ?>

    your code is missing double quote (btw, your code will give static info)

    <?php $tdDesc = this is a description of the category apples(); if ( ! empty( $tdDesc ) ) echo ‘<div class=”archive-desc”>’.$tdDesc.'</div>’; ?>

    well, your atahualpa probably has been modified.
    there is no category.php file in atahualpa theme.

    category description is much longer than category name
    and can post html code using https://www.ads-software.com/extend/plugins/rich-text-tags/

    try this first
    1. activate twentyten theme.
    2. fill in category’s Description
    3. check the category page

    Thread Starter hb2011

    (@hb2011)

    Ok, I tried what you said, including activating TwentyTen.
    The result? HTTP 500 error.

    Now, the only index.php file I could find, had the following code (before I added your code, including the double quotes):

    <?php
    /**
    * Front to the WordPress application. This file doesn’t do anything, but loads
    * wp-blog-header.php which does and tells WordPress to load the theme.
    *
    * @package WordPress
    */

    /**
    * Tells WordPress to load the WordPress theme and output it.
    *
    * @var bool
    */
    define(‘WP_USE_THEMES’, true);

    /** Loads the WordPress Environment and Template */
    require(‘./wp-blog-header.php’);
    ?>

    So, I’m not sure if that’s the file you meant?

    My Atahualpa is not really modified, I just changed some settings via the graphical interface and added maybe one or two lines of code via the CSS inserts option. That is, not in a matter of speach, but really only two lines of code.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘How to create a static info part on the category pages?’ is closed to new replies.