Category: WordPress

Embedded Post Customisation

Have you ever wanted to remove that unsightly site title?

Ever wanted to show who worked on the post?

Well I have and after quite a bit of searching and fiddling I figured it out.

/**
 * Removes the title.
 */
add_filter('embed_site_title_html','__return_false');
/**
 * Adds the author's name.
 */
add_action( 'embed_content', 'embed_author' );
/**
 * Add the author div to the embed iframe.
 */
function embed_author() {
    $output = '<div class="wp-embed-author">';
    $output .= '&mdash; ';
    $output .= get_the_author();
	$output .= " ";
    $output .= get_avatar( get_the_author_meta( 'ID' ), 20 );
    $output .= '</div>';
    echo $output;
}

Just slap this into your theme somewhere (in Beans they have a file called “Embed” that i slipped it into) and voilĂ ! Your site title will disappear and be replaced with the author of the post!

Filed under: WordPressTagged with: ,

Beans Menu Customisation

To change the appearance of the primary menu in the Beans Theme simply alter the “tm-primary-menu”. I’ve done this easily by adding some Additional CSS like so:

To change the text colour of the menu:

.tm-primary-menu .menu-item > a
{
	color: #ccc;
}

In order to change the background and text colour of the current menu item (meaning the link to the page your on at the moment).

.tm-primary-menu .current-menu-item > a {
	background-color: #444
		!important;
	color: #ccc
		!important;
}

To change the background and text colour of whichever menu item the user is hovering the mouse cursor over.

.tm-primary-menu .menu-item > a:hover
{
	background-color: #444;
	color: #ccc;
}
Filed under: WordPressTagged with: ,