• Resolved accretio

    (@accretio)


    Hi, I need some help with editing the function.php theme file.
    I would like to stop wordpress from hyperlinking the titles of my front pages.

    Please tell me what to remove from this code in order to do so:

    **
     * Remove links from entry titles (shortcodes)
     *
     */
    function oxygen_entry_title_shortcode( $title ) {
    
    	global $post;
    
    	if ( is_front_page() && !is_home() ) {
    		$title = the_title( '<h2 class="' . esc_attr( $post->post_type ) . '-title entry-title"><a href="' . get_permalink() . '" title="' . the_title_attribute( 'echo=0' ) . '" rel="bookmark">', '</a></h2>', false );
    	} elseif ( is_singular() ) {
    		$title = the_title( '<h1 class="' . esc_attr( $post->post_type ) . '-title entry-title">', '</h1>', false );
    	} elseif ( 'link_category' == get_query_var( 'taxonomy' ) ) {
    		$title = false;
    	} else {
    		$title = the_title( '<h2 class="entry-title"><a href="' . get_permalink() . '" title="' . the_title_attribute( 'echo=0' ) . '" rel="bookmark">', '</a></h2>', false );
    	}
    
    	/* If there's no post title, return a clickable '(Untitled)'. */
    	if ( empty( $title ) && !is_singular() && 'link_category' !== get_query_var( 'taxonomy' ) )
    		$title = '<h2 class="entry-title no-entry-title"><a href="' . get_permalink() . '" rel="bookmark">' . __( '(Untitled)', 'origin' ) . '</a></h2>';		
    
    	return $title;
    }

    Please help me out here guys, I’m really having trouble with this.

    Thanks

Viewing 1 replies (of 1 total)
  • if ( is_front_page() && !is_home() ) {
    $title = the_title( '<h2 class="' . esc_attr( $post->post_type ) . '-title entry-title"><a href="' . get_permalink() . '" title="' . the_title_attribute( 'echo=0' ) . '" rel="bookmark">', '</a></h2>', false );
    }

    change to

    if ( is_front_page() && !is_home() ) {
    $title = the_title( '<h2 class="' . esc_attr( $post->post_type ) . '-title entry-title">', '</h2>', false );
    }

Viewing 1 replies (of 1 total)
  • The topic ‘Removing title hyperlink’ is closed to new replies.