display( 'Name', false, true ); $slug = preg_replace( "/[\s-]+/", " ", strtolower( hybridextend_trim( $name ) ) ); $slug = str_replace( " ", "-", $slug ); $link = ( empty( $link ) ) ? 'https://wordpress.org/themes/' . $slug : $link; $anchor = ( empty( $anchor ) ) ? $name : $anchor; $title = sprintf( __( '%s WordPress Theme', 'hybrid-core' ), $name ); return sprintf( '%s', esc_url( $link ), esc_attr( $title ), esc_html( $anchor ) ); } /** * Returns a link to the theme URI. * * @since 1.0.0 * @access public * @param string $link * @param string $anchor * @return string */ function hybridextend_get_theme_link( $link = '', $anchor = '' ) { /* Get Theme */ global $hybridextend_theme; $name = ( is_child_theme() ) ? $hybridextend_theme->parent()->get( 'Name' ) : $hybridextend_theme->get( 'Name' ); $link = ( empty( $link ) ) ? ( ( is_child_theme() ) ? $hybridextend_theme->parent()->get( 'ThemeURI' ) : $hybridextend_theme->get( 'ThemeURI' ) ) : $link; $anchor = ( empty( $anchor ) ) ? $name : $anchor; $title = sprintf( __( '%s WordPress Theme', 'hybrid-core' ), $name ); return sprintf( '%s', esc_url( $link ), esc_attr( $title ), esc_html( $anchor ) ); } /** * Filter the WordPress archive title after Hybrid has worked its magic * * @since 2.1.5 * @access public * @param string $title * @return string */ function hybridextend_loop_title( $title ) { $title_suffix = ''; /* If the current page is a paged page. */ if ( ( ( $page = get_query_var( 'paged' ) ) || ( $page = get_query_var( 'page' ) ) ) && $page > 1 ) { $paged = number_format_i18n( absint( $page ) ); $title_suffix = ' ' . sprintf( __( '(Page %s)', 'hybrid-core' ), $paged ) . ''; $title_suffix = apply_filters( 'hybridextend_title_suffix', $title_suffix, $paged ); } return $title . $title_suffix; } add_filter( 'hybrid_archive_title', 'hybridextend_loop_title', 1, 3 );