Jump to content


Photo
- - - - -

How To Add A Category Description To Your Category Pages!

category description category categories

Best Answer James B , 22 August 2013 - 10:23 PM

Hi there,

 

To color the background of that section, you'll need to target the p element of the #section.php. This will give you the following effect - http://screencast.com/t/r8FnnIbmk6zA

 

The only other option I can think of to include the title would be using a hook to insert the text prior to the category posts.

Go to the full post


  • Please log in to reply
27 replies to this topic

#1 catrina

catrina

    Advocate

  • Members
  • 12345 posts
  • LocationCalifornia
  • Country: Country Flag

Posted 24 January 2013 - 08:10 PM

I’m posting this how-to here in case anyone needs it since I think it’s pretty handy.

 

In case you have ever wondered how to add a category description to each of your category pages, here is how you do it! Yay. OK, here's what you need to do (I broke it up into chunks - you just follow the steps from start to finish).

 

PART 1: First you need to install/activate a section and a plugin

1. *If you already have the ContentBox section installed and activated you can skip this step*
To install ContentBox, go to PageLines > Store > Sections > Get New Sections > Top Free then click the "Install" button and then activate it. It won't show up in Drag & Drop if it's not activated!

 

2. Now go to Plugins > Add New and search "Shortcode Exec PHP" and click the "Install Now" link then once it installs activate it by clicking "Activate Plugin". Now you're done installing your stuff!

 

PART 2: Adding the ContentBox to the right place and adding your category description

 

3. Go to PageLines > Drag & Drop and select "Page Templates" OR "Content Area" (depends on which one you want) under "Select Template Area" and "Category" under "For Which Type of Page"

 

4. Drag the ContentBox section from the Available/Disabled Sections area on the right to the top of the Active Sections area on the left (you must arrange ContentBox at the top so that it displays at the top of the page). Now your category description has a home!

 

5. Now go to Post > Categories and mouseover whichever category you want to add a description to and click the "Edit" link.

 

6. Once you've done that, type it in the Description box directly below the "Parent" dropdown menu option and save it by clicking the "Update" button at the bottom. Alright! Your category description is all set! (If you have more categories to add descriptions to, just repeat this step)

 

PART 3: Now it's time to convert the PHP tag WordPress provides for adding category descriptions to templates to a shortcode that can be added to ContentBox!

 

7. Go to Tools > Shortcode Exec PHP on the left side of your Dashboard and scroll down. You're going to see an empty box that looks like this:

Please Login or Register to see this Hidden Content

 

Please Login or Register to see this Hidden Content

  14.57KB   125 downloads

 

8. In the field at the top, type in categ_des (short for "category description" so you know that's what the shortcode is going to be for) and then add the following code to the box EXACTLY as it is (don't add spaces or any extra code). It'll occupy just one line in that box (please see the Attached Thumbnail at the bottom of this post to see what the box should look like).

 

9. Now click on the "Save" button below the box and now you've got your shortcode! The shortcode is as shown at the top of the box with the brackets added on each side: [categ_des]

 

PART 4: Adding the shortcode to ContentBox and finishing it off!

 

10. Now go to PageLines > Page Options > Category Page and select ContentBox (note: if this section is showing up as inactive, please go to PageLines > Store > Sections > Your Added Sections and click the Activate button to activate it!).

 

11. In the Content Box Content area, add your shortcode [categ_des] so that it looks like this:

Please Login or Register to see this Hidden Content

 

Please Login or Register to see this Hidden Content

  12.71KB   161 downloads

 

Click "Save Options" and check out that spankin' new description at the top of your category page! YAY! Here's mine as an example:

Please Login or Register to see this Hidden Content

 

Please Login or Register to see this Hidden Content

  46.61KB   149 downloads
Note: I didn't make any adjustments with CSS which accounts for the spacing weirdness, but you can easily take care of any appearance issues using Custom CSS.

 

You're done! Time to celebrate with a few party kittens:

 

Please Login or Register to see this Hidden Content

 

Please Login or Register to see this Hidden Content

  50.85KB   127 downloads

Attached Files


  • Simon_P, batman, backbone and 1 other like this

#2 batman

batman

    Bat Learning

  • Members

  • 2165 posts
  • LocationBuenos Aires, Argentina
  • Framework Version:DMS
  • Country: Country Flag

Posted 24 January 2013 - 08:53 PM

Hi Catrina
Thank you very much for your excellent explanation ! !
I take note
wpml_mail.gif


#3 jenbrea

jenbrea

    Newbie

  • Members
  • 1 posts

Posted 12 February 2013 - 06:57 PM

This is absolutely fantastic. I thought finding a solution would be difficult, but this is perfect. Thank you!!



#4 mulryjohn

mulryjohn

    Newbie

  • Members
  • 3 posts

Posted 23 March 2013 - 03:28 PM

Hi there,

 

I cannot seem to populate the description box at all in any of my categories. When I place the mouse to put the cursor in the text box it won't populate and it just flashes with a blue line at the bottom of the box. Uber frustrating. Do you know why this might be?

 

Thanks,

 

John.



#5 Rob

Rob

    One Smart Egg

  • Members
  • 13575 posts
  • LocationEast Coast, USA
  • Framework Version:The Latest, of course
  • Country: Country Flag

Posted 23 March 2013 - 03:31 PM

Hi.

 

It's probably a plugin conflict. Do you have many plugins? Particularly older ones? Deactivate all non-PageLines plugins and see if the issue resolves.



#6 mulryjohn

mulryjohn

    Newbie

  • Members
  • 3 posts

Posted 24 March 2013 - 04:27 PM

Thanks guts got it working. In my category descriptions I got my silo builder set up but they are not showing. Have you to configure anything special in Pagelines for them to show?



#7 Rob

Rob

    One Smart Egg

  • Members
  • 13575 posts
  • LocationEast Coast, USA
  • Framework Version:The Latest, of course
  • Country: Country Flag

Posted 24 March 2013 - 04:40 PM

I don't know about 3rd party premium plugins.  The process should work provided you've added the description to the category in Dashboard > Posts > Categories under each category. Unfortunately, I can't support the 3rd party plugin or even analyze what it's doing.



#8 mulryjohn

mulryjohn

    Newbie

  • Members
  • 3 posts

Posted 24 March 2013 - 04:47 PM

Ok thanks, I'll see if I can get it sorted



#9 Rob

Rob

    One Smart Egg

  • Members
  • 13575 posts
  • LocationEast Coast, USA
  • Framework Version:The Latest, of course
  • Country: Country Flag

Posted 24 March 2013 - 04:52 PM

Out of curiosity, does it work properly with the Silo Plugin deactivated?



#10 rowin

rowin

    Member

  • Members
  • 17 posts
  • LocationDeventer
  • Country: Country Flag

Posted 12 July 2013 - 10:23 PM

Thanks a lot!! Good advice!   :)

 

Anyone know how to change the CSS as well for "category description", so the CSS is the same as a "post loop"?

 

I would like the same CSS (white block) for the text (category description). 

My website: 

Please Login or Register to see this Hidden Content

 

Hopefully someone knows how to fix this? 

 

best regards,

rowin 



#11 James B

James B

    Advocate

  • Members

  • 5126 posts
  • LocationSurrey - UK
  • Country: Country Flag

Posted 12 July 2013 - 11:14 PM

Hi Rowin,

 

If you have firebug or chrome dev tools you can copy the css styles which are applied to the postloop and then apply them to the new title you've entered. #section.php .content-pad

 

Example of what's coloring the postloop currently -

Please Login or Register to see this Hidden Content



#12 rowin

rowin

    Member

  • Members
  • 17 posts
  • LocationDeventer
  • Country: Country Flag

Posted 21 August 2013 - 05:22 PM

Hi Rowin,

 

If you have firebug or chrome dev tools you can copy the css styles which are applied to the postloop and then apply them to the new title you've entered. #section.php .content-pad

 

Example of what's coloring the postloop currently -

Please Login or Register to see this Hidden Content

 

Hi James,

 

thanks for your answer. Sorry for my late reaction... I was busy, so hopefully you can help me out.

 

In the custom CSS I paste the following code:

 

 

section#content-pad {
padding: 20px;
margin-top: -14px;
margin-right: 0px;
background: rgba(255,255,255,0.85);
border-radius: 0.8em;
border-style: solid;
border-width: 1px;
border-color: blue;
box-shadow: 1px 2px 4px 0px rgba(0,0,0,0.7), inset 1px 1px 4px 0px rgba(0,0,0,0.7);
}
 
There is no changing.... Is the above CSS wrong?
I also tried:
 
#section.php .content-pad {
padding: 20px;
margin-top: -14px;
margin-right: 0px;
background: rgba(255,255,255,0.85);
border-radius: 0.8em;
border-style: solid;
border-width: 1px;
border-color: blue;
box-shadow: 1px 2px 4px 0px rgba(0,0,0,0.7), inset 1px 1px 4px 0px rgba(0,0,0,0.7);
}
 
 
 
 
Thanks a lot... 
 
Rowin.


#13 rowin

rowin

    Member

  • Members
  • 17 posts
  • LocationDeventer
  • Country: Country Flag

Posted 21 August 2013 - 06:41 PM

And I use the plugin Shortcode Exec PHP for show up the description of my category's....

So I think It's somewhere in the css of this plugin, but I'm not shore??? Hopefully somebody can help me out!

 

If there is another option to show up the description of the category (and with the CSS of the postloop) this is also allright?!?



#14 James B

James B

    Advocate

  • Members

  • 5126 posts
  • LocationSurrey - UK
  • Country: Country Flag

Posted 22 August 2013 - 10:23 PM   Best Answer

Hi there,

 

To color the background of that section, you'll need to target the p element of the #section.php. This will give you the following effect -

Please Login or Register to see this Hidden Content

 

The only other option I can think of to include the title would be using a hook to insert the text prior to the category posts.



#15 gayatriom

gayatriom

    Advocate

  • Members

  • 559 posts
  • Country: Country Flag

Posted 23 August 2013 - 09:48 PM

This is genius! 



#16 Rob

Rob

    One Smart Egg

  • Members
  • 13575 posts
  • LocationEast Coast, USA
  • Framework Version:The Latest, of course
  • Country: Country Flag

Posted 27 August 2013 - 05:17 PM

Yeah, we think @

Please Login or Register to see this Hidden Content

is a genius too!



#17 rowin

rowin

    Member

  • Members
  • 17 posts
  • LocationDeventer
  • Country: Country Flag

Posted 09 September 2013 - 05:50 PM

Hi there,

 

To color the background of that section, you'll need to target the p element of the #section.php. This will give you the following effect -

Please Login or Register to see this Hidden Content

 

The only other option I can think of to include the title would be using a hook to insert the text prior to the category posts.

 

Hi James,

 

Thanks for your support. Looks good! How does this works exactly? Which (exactly) custom CSS I have to use and can I put this at "Custom CSS" at "sitesettings" ?

 

Thanks a lot!



#18 bigtopmultimedia

bigtopmultimedia

    Member

  • Members

  • 23 posts
  • Country: Country Flag

Posted 23 October 2013 - 12:56 PM

If you are using a child theme, you can do the following to add the category description below the title:

 

1. Copy the postsinfo folder from /pagelines/sections/ into your /child-theme/sections/ folder

2. Around line 29 of /child-theme/sections/postsinfo/section.php you will see something like:

Please Login or Register to see this Hidden Content

3. Change this to:

Please Login or Register to see this Hidden Content

The description will be wrapped in a div with the class "cat-desc" for CSS purposes


  • CliffordP and Jake like this

#19 rpacker

rpacker

    Super Member

  • Members
  • 232 posts
  • LocationWashington, DC
  • Framework Version:2.3.5
  • Country: Country Flag

Posted 02 May 2014 - 08:05 PM

I am using Pagelines Framework and would like to add a category description, but I am unable to access any of the sections in the Pagelines store, including ContentBox. Is there another way to do this? Does the Pagelines store still exist for Framework?



#20 CliffordP

CliffordP

    Advocate

  • Members


  • 474 posts
  • LocationOklahoma
  • Country: Country Flag

Posted 02 May 2014 - 09:51 PM

PageLines Framework store is no more. Everything but DMS 2 is all but abandoned.







Also tagged with one or more of these keywords: category description, category, categories