Tools Web Design

WordPress Hacks to Style Out Your Blog Theme

4.5/5 (4)

It seems that almost every third WordPress user has encountered with the issue: hack or not to hack? Actually, this is quite rhetorical question and it is hard to give a precise answer. WordPress hacks allow you to make really unique things with your WordPress website but require having certain coding and programming skills.

It is obvious thing that many WordPress users often want to customize certain design elements of their website but don't know how to do that. Yeah, details are important and that's why some smart guys have created WordPress theme hacks that could change your blog design with the help of some little tricks. Of course we are always glad to hear about your favorite theme hacks so, feel free to tell us about it at the comments section.

Disabling WordPress plugin deactivation and theme changing

add_filter( 'plugin_action_links', 'slt_lock_plugins', 10, 4 );  
function slt_lock_plugins( $actions, $plugin_file, $plugin_data, $context ) {  
    // Remove edit link for all  
    if ( array_key_exists( 'edit', $actions ) )  
        unset( $actions['edit'] );  
    // Remove deactivate link for crucial plugins  
    if ( array_key_exists( 'deactivate', $actions ) && in_array( $plugin_file, array(  
        'slt-custom-fields/slt-custom-fields.php',  
        'slt-file-select/slt-file-select.php',  
        'slt-simple-events/slt-simple-events.php',  
        'slt-widgets/slt-widgets.php'  
    )))  
        unset( $actions['deactivate'] );  
    return $actions;  
}

* * *

Embed a Page inside a Page

* * *

How to change WordPress editor font

add_action( 'admin_head-post.php', 'devpress_fix_html_editor_font' );
add_action( 'admin_head-post-new.php', 'devpress_fix_html_editor_font' );

function devpress_fix_html_editor_font() { ?>

* * *

Change WordPress “from” email header

function res_fromemail($email) {
    $wpfrom = get_option('admin_email');
    return $wpfrom;
}

function res_fromname($email){
    $wpfrom = get_option('blogname');
    return $wpfrom;
}

add_filter('wp_mail_from', 'res_fromemail');
add_filter('wp_mail_from_name', 'res_fromname');

* * *

Recent Posts With Thumbnails In WordPress Without A Plugin

* * *

Display Random Posts in WordPress Without a Plugin

* * *

Customize WordPress login logo without a plugin

function my_custom_login_logo() {
    echo '

'; } add_action('login_head', 'my_custom_login_logo');

* * *

Show Related Post in WordPress Without a Plugin

Related Posts

    • '; while ($my_query->have_posts()) { $my_query->the_post(); ?>

 

* * *

How to highlight author comments in WordPress

  • user_id)
    $oddcomment = "authcomment";
    echo $oddcomment;
    ?>" id="comment"...

* * *

Displaying WordPress categories in a horizontal dropdown menu

// <![CDATA[
var mbA,mbT,mbTf,mbSf;
var mbR = [];

function mbSet(m) {
if (document.getElementById&&document.createElement) {
var m=document.getElementById(m);
mbR[mbR.length] = m;
var i;

e=m.getElementsByTagName('a');
if (!mbTf) mbTf=new Function('mbHT();');
if (!mbSf) mbSf=new Function('mbS(this);');
for (i=0;i<e.length;i++) {
e[i].onmouseout=e[i].onblur=mbTf;
e[i].onmouseover=e[i].onfocus=mbSf;
}

m=m.getElementsByTagName('ul');
for (i=0;i<m.length;i++) {
mbH(mbL(m[i]));
}
}}

function mbHA() {
if (mbA) {
while (mbA) mbH(mbA);
mbHE('block');
}
}

function mbHT() {
if (!mbT) mbT=setTimeout('mbHA();', 0);
}

function mbTC() {
if (mbT) {
clearTimeout(mbT);
mbT=null;
}
}

function mbS(m) {
mbTC();
if (mbA) while (mbA&&m!=mbA&&mbP(m)!=mbA) mbH(mbA);
else mbHE('none');

if (mbM(m)) {
mbSH(m,'block');
mbA=m;
}
}

function mbH(m) {
if (m==mbA) mbA=mbP(m);
mbSH(m,'none');
mbT=null;
}

function mbL(m) {
while (m && m.tagName != 'A') m = m.previousSibling;
return m;
}

function mbM(l) {
while (l && l.tagName != 'UL') l = l.nextSibling;
return l;
}

function mbP(m) {
var p = m.parentNode.parentNode;
if (p.tagName == 'UL') {
var i = 0;
while (i < mbR.length) {
if (mbR[i] == p) return null;
i++;
}
} else {
return null;
}
return mbL(p);
}

function mbSH(m,v) {
m.className=v;
mbM(m).style.display=v;
}

function mbHE(v) {
mbHEV(v,document.getElementsByTagName('select'));
}

function mbHEV(v,e) {
for (var i=0;i

* * *

  • Donaldmathis

    Great Job! I can use this information

  • Kathy Stroud

    I’d love to see how you’d add a WordPress enabled page to an existing website.

  • Hunzaboy

    is there any way to show posts from one wordpress installation on another? on different domains?

  • Trickz100

    Just a small typo in the coding on the “WordPress add post thumbnails to RSS” I think;

    Find:

    unction rss_post_thumbnail($content) {

    Replace:

    function rss_post_thumbnail($content) {

    • Edward Korcheg

       Thanks, fixed that =)

      • Trickz100

        No worries 🙂 Some great hacks here, I have this page bookmarked for future use, thanks! 🙂

  • Jacob Stoops

    Thanks for the mention of my article Edward

  • tefaa

    how to remove links from admin menu like testimonial / FAQ / our members