Jump to content
Sign in to follow this  
climbur

Displaying A Post's Category

Recommended Posts

climbur    0
climbur

So on Climbur.com I want to be able to have text like this at the top of each post underneath the post title:

 

This story will inspire you to CREATE.

 

or 

 

This story will inspire you to THINK.

 

The words in all caps are my categories on the site. How do I make it so I can add this text and automatically pull in the text with the category name (where it's in all caps)?

 

Thanks!

Share this post


Link to post
Share on other sites
James B    436
James B

Hi there

 

To achieve this you'll need to use a hook to insert some code into the relevant position on the page. You can use the actionmap plugin from the store to find the position you want the text to appear, then use either hooker plugin to insert the code. You can find out more about hooks here http://support.pagelines.me/docs/customization/hooks/

 

I'm not a developer, but I think the code you'll need to insert into the hook will look something like the following

<p><?php single_cat_title('This store will inspire you to '); ?>.</p>

Kindly search the forum and read the documentation before posting. It will help you resolve many issues.

For CSS help be sure to check out W3Schools first and be sure to download FireBug for FireFox for troubleshooting.

James B

Share this post


Link to post
Share on other sites
climbur    0
climbur

Thanks James. Do you know how to make the category itself a link?

Share this post


Link to post
Share on other sites
climbur    0
climbur

Also, that didn't work :) It just displayed a period and no text/category...

Share this post


Link to post
Share on other sites
climbur    0
climbur

Thanks. I just tried putting in: <?php get_category_link$category_id ); ?> 

 

Using the pagelines_loop_before_post_content hook and it displayed nothing...

Share this post


Link to post
Share on other sites
climbur    0
climbur

Thanks for sticking with me on this subject trying to solve it. Unfortunately, not a single example from that page works via the hook editor. It always outputs partial code, but no Category/Link. 

Share this post


Link to post
Share on other sites
catrina    103
catrina

Hm, and is this on an individual post page or a post within the blog page?


Please read the docs before posting. Please do not private message me unless I ask you to.

Designer | Catrina Dulay

Founder | Catrina and Mouse

Share this post


Link to post
Share on other sites
James B    436
James B

Hi there,

 

To enable php to be used within the hooker plugin you'll need to add define( 'PL_HOOKS_PHP', true ); to the wp-config first as mentioned in the plugin instructions. Hooker will only allow html/js/css by default, php will need to be added using that code.


Kindly search the forum and read the documentation before posting. It will help you resolve many issues.

For CSS help be sure to check out W3Schools first and be sure to download FireBug for FireFox for troubleshooting.

James B

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

×