• Hey

    In functions.php using ‘%1$s’ inserts the category name but hyperlinked is there a way to do it without it being hyperlinked?

    Thanks.

    Matt

Viewing 5 replies - 1 through 5 (of 5 total)
  • not enough info – can you post the full code of that section from functions.php?

    (please follow the guidelines for posting code: https://codex.www.ads-software.com/Forum_Welcome#Posting_Code )

    Thread Starter Matt Lovett

    (@mdeluk)

    Hey

    Where it says ‘We save you time by listing: %1$s vouchers.’ I did not want it to be hyperlinked in this sentence but its fine in the occurrence when it says This post was posted in: CATEGORY.

    https://pastebin.com/ejyR0nnj

    Thread Starter Matt Lovett

    (@mdeluk)

    no that did not work ??

    I’m trying to figure this out too.

    I made a new function.

    Now just trying to figure out why %1$s produces the anchor tag version of the category name instead of just the plain text format instead??

    I’m thinking it partly has to do with this as well: = __

    ?? Not too sure? Cause the normal Category reference: %s
    does not work either in place of %1$s.

    if ( ! function_exists( 'designconcepts_posted_under' ) ) :
    /**
     * Prints HTML with title information for the current single post (category title).
     *
     * @since Design Concepts 1.0
     */
    function designconcepts_posted_under() {
    	// Retrieves tag list of current post, separated by commas.
    	$tag_list = get_the_tag_list( '', ', ' );
    	if ( $tag_list ) {
    		$posted_in = __( '%1$s', 'designconcepts' );
    	} elseif ( is_object_in_taxonomy( get_post_type(), 'category' ) ) {
    		$posted_in = __( '%1$s', 'designconcepts' );
    	} else {
    		$posted_in = __( '%1$s', 'designconcepts' );
    	}
    	// Prints the string, replacing the placeholders.
    	printf(
    		$posted_in,
    		get_the_category_list( ', ' ),
    		$tag_list,
    		get_permalink(),
    		the_title_attribute( 'echo=0' )
    	);
    }
    endif;
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘%1$s inserts category name as a hyperlink – how not link?’ is closed to new replies.