A few CSS things


#1

Hi, I would like to adjust a few things 1. Change The color of the post title 2. Change the "Comment" in the top corner of a post to black not blue. 3. Change the comment section links to black. I changed the generic and and default to gray with blue hover. Which changed every link. Id like to just have the links in a post be gray and everything else in the reply and widgets be black. I have changed the widget link color by adding a CSS rule

.widget ul li a { color: #000;} But I think there could be an easier way of just making the links inside a post be gray. 4. Also I tried the Jquery for making every line besides a internal link open in a new page, and It doesn't work.

Thanks so much!


#2

Hi rcmorris11,

I have added CSS code with the comments, add this code in style.css and do not forget to update color code.

Change the color of the post title

.post-title a, .post-title a:visited, .post-title a:active { color: blue; }  
.post-title a:visited { color: red; }  

Change the "Comment" in the top corner of a post to black

.rtp-post-comment, .rtp-post-comment:visited, .rtp-post-comment:active { color: black; }   
.rtp-post-comment:hover { color: blue; }  

Change links color in post content

.post-content a, .post-content a:visited, .post-content a:active { color: gray; }  
.post-content a:hover { color: blue; }  

Change links color in comments and widget text

.widget a, .widget a:active, .widget a:visited, .comment-text a, .comment-text a:visited, .comment-text a:active { color: black; }   
.widget a:hover, .comment-text a:hover { color: blue; }  

To open external links in new page, add the below code in custom.js file.

jQuery( document ).ready( function() {   
    var comp = new RegExp( location.host );   
    jQuery( 'a' ).each(function(){   
        if ( comp.test( jQuery( this ).attr( 'href' ) ) ) { }  
        else { jQuery( this ).attr( 'target', '_blank' ); }  
    } );   
} );  

Let me know if you have any doubt in above code.

Thanks, Manish


#3

Sorry where do I added the JQuery code?


#4

Hi rcmorris11,

You need to add this jQuery in any .js file which included in your theme.

Follow the steps if you have't added any custom jQuery file in rtPanel.

1) Create new "rtp-custom-scripts.js" file in js folder. You can find this js folder in (rtPanel) root directory. Now add the code to this file which I sent you.

2) Copy the below code to your functions.php file. This code will include the "rtp-custom-scripts.js" file in your theme.

function rtp_custom_scripts_and_styles() {  
    wp_enqueue_script( 'rtp-custom-script', RTP_JS_FOLDER_URL . '/rtp-custom-scripts.js', array( 'jquery' ), '', true );  
}  
add_action( 'wp_enqueue_scripts', 'rtp_custom_scripts_and_styles', 11 );  

Let me know if it works.

Thanks, Manish


#5