Hi,
First of all, your plugin is awesome.
Thank you! ??
I can edit or create any file you desire. But I think a new update of the theme will override this change. I’ll be waiting for your steps to do this, though.
You’re right. For this reason I recommend using a child theme (if you’re not using a custom theme) or a functionality plugin.
If you decide to use a child theme and after you have created and activated the child theme, here the steps to add the modification for Posts in Sidebar:
1) Inside your child theme directory create a directory named scripts
.
2) Inside this new directory, create a new file named pis-hacks.js
and paste this content:
jQuery(document).ready(function(){
jQuery('a.pis-title-link').attr('target','_blank');
});
Save the file.
3) Open the file functions.php
of your child theme and paste these lines at the end of the file:
function posts_in_sidebar_hacks() {
wp_register_script(
'pis_scripts',
get_stylesheet_directory_uri() . '/scripts/pis-hacks.js',
array( 'jquery' ),
'1.0.0',
true
);
wp_enqueue_script( 'pis_scripts' );
}
add_action( 'wp_enqueue_scripts', 'posts_in_sidebar_hacks' );
Make sure to paste these lines before the closing PHP tag ?>
, if present.
Save the file and test the result.
Please, let me know.