Search
 
SCRIPT & CODE EXAMPLE
 

PHP

Show All Categories as Links


$categories = get_the_category();
$separator = ' ';
$output = '';
if ( ! empty( $categories ) ) {
    foreach( $categories as $category ) {
        $output .= '<a href="' . esc_url( get_category_link( $category->term_id ) ) . '" alt="' . esc_attr( sprintf( __( 'View all posts in %s', 'textdomain' ), $category->name ) ) . '">' . esc_html( $category->name ) . '</a>' . $separator;
    }
    echo trim( $output, $separator );
}
Comment

PREVIOUS NEXT
Code Example
Php :: PHP strtok — Tokenize string 
Php :: encode zlib php 
Php :: append single qoute arounf variable in php string 
Php :: php random number 
Php :: php get json objects by key without indez 
Php :: woocommerce function traduccion label 
Php :: like button phpAdd Answer 
Php :: php get function from different file 
Php :: Toaster switch Statement 
Php :: kill php-fpm inside docker 
Php :: php howto ignore file with BOM 
Php :: public path() does not work on live server laravel. Problem with public path on live server 
Php :: wp menu declaration 
Php :: entrust laravel 
Php :: Uncaught Error: Call to undefined function add_submenu_page() 
Php :: guzzlehttp submit form file 
Php :: log magenot 1 
Php :: php signature capture 
Php :: symfony get locale from request in controller 
Php :: bd sms gateway, laravel sms gateway, sms sending library, bd sms, sms gateway 
Php :: custom blade if directive 
Php :: laravel how to query belongsTo relationship 
Php :: php function return multiple values 
Php :: dropdown search php mysql 
Php :: livewire model array 
Php :: Bootstrap paginator css not appearing 
Php :: laravel route group 
Php :: Fetch pivot data laravel 
Php :: make model factory and controller laravel 
Php :: pivot table in laravel 9 
ADD CONTENT
Topic
Content
Source link
Name
3+1 =