Jump to content
Sign in to follow this  
jbrouwer

show custom field in clip_box

Recommended Posts

jbrouwer

Hi, I would like to show some custom fields in the clip_box on the frontpage when magazine layout mode is enabled. I tried using the hook the_post, but then the custom fields are displayed above the thumb/title/etc, while I would like to display them under the excerpt. Any ideas how to work this out? Thanks.

Share this post


Link to post
Share on other sites
jbrouwer
I am testing local, but you pointed me to the right direction. Didn't know that was possible with css. Is this a robust solution? [code] .project-details{ position: absolute; top: 200px; } .clip{ position: relative; padding-bottom: 60px; } [/code] Thanks.

Share this post


Link to post
Share on other sites
jbrouwer
Actually, seems that the hook 'the_post' is attached to many more places (boxes, features, sinlge posts). Is there another way to show some custom fields in a the clip box?

Share this post


Link to post
Share on other sites
jbrouwer
Hmm, finding the right css code is harder than I thought. Used an if statement to display the custom fields only on the homepage. This is the code I added to functions.php: [code] add_action('the_post', 'add_project_details'); function add_project_details(){ global $post; if (in_the_loop() && is_home()){ ?>
ID, 'investering', true); echo 'Investering: '; echo $investering; ?>
ID, 'plaats', true); echo 'Plaats: '; echo $plaats; ?>

Share this post


Link to post
Share on other sites
catrina
If CSS is used to reposition the custom fields, the positioning might be inconsistent in each clip box because each clip box will probably be different heights. I think it's best to somehow put the custom fields under the clip box rather than putting them there then moving them down using CSS. Perhaps this hook would work better: pagelines_loop_clipbox_end (worth a shot)

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
jbrouwer
No luck. Are there more hooks available than this list? http://api.pagelines.com/hooks

Share this post


Link to post
Share on other sites
catrina
Hm, I thought pagelines_loop_clipbox_end was still working. Those are all of the hooks that are available for Pagelines 2.0. I think CSS is looking like the best solution for moving those custom fields.

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
jbrouwer
Ok. That's a pity! Do you have a suggestion how to work this out with CSS? I played around with absolute and relative postions, but couldn't get it aligned. I would appreciate it very much.

Share this post


Link to post
Share on other sites
catrina
I'm quite sure a link was posted somewhere in this thread before since I remember testing CSS out on your site. Can you post that link?

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
jbrouwer
Sure! [url]test.pepperbase.com[/url] (uses pagelines framework). I am trying to make it look like this: [url]www.pepperbase.com[/url] which uses the platform pro theme.

Share this post


Link to post
Share on other sites
kastelic
Have you tried some of these hooks? Some are specific to the clips. pagelines_loop_post_start pagelines_loop_page_title_after pagelines_loop_post_header_start pagelines_before_excerpt // 1.5.1 pagelines_after_excerpt pagelines_loop_before_post_content pagelines_loop_after_post_content pagelines_loop_post_end pagelines_loop_clipbox_start pagelines_loop_clip_start pagelines_loop_clip_excerpt_end pagelines_loop_clip_end pagelines_loop_clipbox_end

Share this post


Link to post
Share on other sites
jbrouwer
Do they work in Pagelines Framework? I will give it a try, but thought, as mentioned above, that this [url]http://api.pagelines.com/hooks[/url] was the complete list of hooks for framework. Thx.

Share this post


Link to post
Share on other sites
jbrouwer
@simple_mama thanks for the suggestion. What I ment was that none of the suggested hooks work in framework. I've tested the function with other hooks where it works fine (e.g. the_loop). However, I am looking for a solution to add custom fields under the excerpt in a clip. With the hook the_loop in action this is the result: [url]test.pepperbase.com[/url], which is not what I'am looking for. Any other suggestions?

Share this post


Link to post
Share on other sites
Rob
I've asked a developer to look into this.

Former PageLines Moderator, Food Expert and Raconteur

Share this post


Link to post
Share on other sites
jbrouwer
Just to follow up. Finnaly found the solution. I used the excerpt filter to add some custom fields in the clip box in magazine layout mode: [code]add_filter('pagelines_excerpt', 'my_excerpt', 10, 6); function my_excerpt($excerpt){ global $post; $investering = get_post_meta($post->ID, 'investering', true); $plaats = get_post_meta($post->ID, 'plaats', true); $category = get_the_category($post->ID); $project = '
' . 'Investering: ' . $investering . '
Plaats: ' . $plaats . '
Categorie: ' . ''.$category[0]->cat_name.'' . '
'; $excerpt = $excerpt . $project; return $excerpt; }[/code] This is the result: [img]http://www.pepperbase.com/wp-content/uploads/clip-box.png[/img]

Share this post


Link to post
Share on other sites
jbrouwer
Not besides some discussions I already opened. Thanks.

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  

×