Is there anyway to relate a category tag pair to a entries tag pair? I have this code below and I am trying to get the 'long_head' custom category name to relate to the entries being outputted above it. So if the entry above had a category of 'BEANS' I would like the 'long_head' to be the long head from the category 'BEANS'.
Any help would be great.
{exp:channel:entries channel="services" limit="1"}
<div id="page">
<h2>{title}</h2>
<div>
{service_text}
</div>
</div>
<!-- // page -->
{/exp:channel:entries}
<div id="nxtBack">
<p><a href="{site_url}" title="Back to Home Page">← Back to Home Page</a></p>
</div>
<div id="rel-work">
{exp:channel:categories style="none"}
<h2>{long_head} Projects</h2>
{/exp:channel:categories}
<ul>
{exp:channel:entries channel="work" limit="20" status="New|Open" related_categories_mode="yes" custom_fields="yes"}
{if no_results}
<p class="alert">There are currently no related projects to this service in our online portfolio.</p>
{/if}
<li>
<a href="{title_permalink="work/view"}" title="{title}"><img src="{project_th}" alt="{title}" />{if status == "New"}<img src="/_/img/new-work.png" class="new" alt="NEW Project - {title}" />{/if}</a>
<h3><a href="{title_permalink="work/view"}" title="">{title}</a></h3>
<h4>{categories backspace="2"}<a href="{path="work"}" title="">{category_name}</a> / {/categories}</h4>
<p>{project_excerpt}</p>
</li>
{/exp:channel:entries}
</ul>
<p><a href="{site_url}work" title="View all work">View all work →</a></p>
</div>
<!-- // rel-work -->