Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter Larryhir

    (@larryhir)

    I installed your plugin and changed the call in my template to:

    $categoryID = get_post_custom_values("_category_permalink");
    print $scategoryID[0];

    which generates the ID

    Still is there any way way to get this to generate the name in the template?

    I am also interested in how to display the permalink category name in my template.

    Larryhir, were you ever able to figure this out?

    Thread Starter Larryhir

    (@larryhir)

    The plugin works for the page url and can only pull the ID from what I’ve found. My solution for the template was to add a custom field called it “catmain” with the correct primary category, call that field into the template where needed. It works and not too much effort. The existing theme had a series of conditionals which I added to, so only if catmain is present does it override the standard page title structure. The snippet looks like this and had to be worked in with the help of the developer.
    …other conditions…

    elseif (is_single()) {
    	if ( get_post_meta($post->ID, 'catmain', true) )  { ?>
        	<h1 class="blog-single-title whereAmI">
    			<?php echo get_post_meta($post->ID, 'catmain', true) ; ?>
        	</h1>
    	<?php } else {
    $category = get_the_category($post->ID) ;
    
    	// are we using a Blog?
    	if ($blog_Name != 'Select a Category' && (cat_is_ancestor_of( $blog_ID, (int)$category[0]->term_id ) || (int)$category[0]->term_id == $blog_ID)) { ?>
    		<h1 class="blog-single-title whereAmI">
    			<?php echo $category[0]->name; ?>
    		</h1>
    	<?php }

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Plugin: Hikari Category Permalink] Trying to call the scategory name into template’ is closed to new replies.