• Hi, I am looking for the following code in my theme:

    <h2 class="page-title entry-title">
    <a rel="bookmark" title="Introducing: NipponReview" href="http://nipponreview.kdmonline.co.za/">Introducing: NipponReview</a>

    In what .php file can it be found? Please help, I’m desperate.

    Thanks

Viewing 15 replies - 1 through 15 (of 16 total)
  • It depends upon your theme. Try looking in index.php or page.php.

    Or possibly a loop.php file.

    Thread Starter accretio

    (@accretio)

    Okay, thanks guys. Will have a look and let you know.

    Thread Starter accretio

    (@accretio)

    Bad news, can’t find it in either of the 3 files. Any other suggestions? Please guys, I’m really desperate!

    The title is probably being generated during the page load so I doubt you will find the exact text in any of your php files.

    Thread Starter accretio

    (@accretio)

    Okay, I think you’re right David.

    What I’m trying to is remove the hyperlink from the title “Introducing: NipponReview” and make it red.

    Here is a link: http://nipponreview.kdmonline.co.za

    I also want all the static page titles to be this way in future.

    How would I go about doing this? Any help would really be appreciated.

    Just search your theme template files for the CSS classes page-title entry-title. Where you find these just remove the link tag that wraps around the title.

    To make it red you need to modify your styles but you will have to edit your style.css. I would recommend doing this in a child theme to preserve your changes. Or at the very least backup your theme first.

    Phil

    (@owendevelopment)

    There will be something in your page.php or single.php like this:

    <h2 class="page-title entry-title">
    <a rel="bookmark" title="<?php the_title(); ?>" href=" <?php the_permalink(); ?>"><?php the_title(); ?></a></h2>

    You basically want to edit it without the link:

    <h2 class="page-title entry-title"><?php the_title(); ?></h2>

    Hope that helps!

    Phil

    (@owendevelopment)

    To make it red, open style.css and add:

    h2.page-title {
    color: #cc0000;
    }

    Thread Starter accretio

    (@accretio)

    Thanks guys, will try your suggestions and let you know…

    Thread Starter accretio

    (@accretio)

    Bad news again. Phil, I searched through both page.php and single.php and I couldn’t find find any of the code that you provided.

    And David, I also searched for the those two things and I couldn’t find them as well.

    Please guys, could you help me some more?

    Phil

    (@owendevelopment)

    functions.php:

    /**
     * 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 );
    	}

    Just remove the a tags…

    🙂

    Thread Starter accretio

    (@accretio)

    Okay, thanks Phil. Will try it out and let you know like before.

    Thread Starter accretio

    (@accretio)

    Thanks so much Phil, I think I’m on the right track now. But I’m still having some trouble with the code. What exactly should I remove from it?

    Here is the code from my side:

    **
     * 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;
    }

    Sorry for asking all these questions, but I really need your help.

    Thanks

    Phil

    (@owendevelopment)

    Try changing to this:

    **
     * 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">', '</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;
    }

    Do a backup of your functions.php file first incase you need to revert it back. All I’ve done here is remove the tags from the h2.

Viewing 15 replies - 1 through 15 (of 16 total)
  • The topic ‘Where is html stored?’ is closed to new replies.