Forum Replies Created
-
I use the following code: I put it in a plugin but I think it should work in your
functions.php
.//
Facebook Widget
class FacebookWidget extends WP_Widget
{
function FacebookWidget()
{
$widget_ops = array('classname' => 'FacebookWidget', 'description' => 'Displays a Facebook Link' );
$this->WP_Widget('FacebookWidget', 'Facebook Link', $widget_ops);
}
function form($instance)
{
$instance = wp_parse_args( (array) $instance, array( 'title' => '' ) );
$title = $instance['title'];
?>
<p><label for="<?php echo $this->get_field_id('title'); ?>">Title: <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo attribute_escape($title); ?>" /></label></p>
<?php
}
function update($new_instance, $old_instance)
{
$instance = $old_instance;
$instance['title'] = $new_instance['title'];
return $instance;
}
function widget($args, $instance)
{
extract($args, EXTR_SKIP);
echo $before_widget;
$title = '<a href="http://www.facebook.com/WasdaleMRT" title="Visit our Facebook page" rel="nofollow">Facebook Latest</a>';
if (!empty($title))
echo $before_title . $title . $after_title;
echo '<div id="fb-root"></div><script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script><fb:like-box href="http://www.facebook.com/wasdalemrt" width="255" height="588" show_faces="true" border_color="" stream="true" header="false"></fb:like-box>';
echo $after_widget;
}
}
add_action( 'widgets_init', create_function('', 'return register_widget("FacebookWidget");') );This should create a new widget that you can place on your site. You just need to change the target in the link and the facebook username. You may have to play around with the css and height and width to get it to fit. You should be able to use firebug on my version to see what I did to get it to line up.
I hope this helps.
Jon
What you need is the ability to edit the excerpt for your pages, I suggest reading http://www.wpbeginner.com/plugins/add-excerpts-to-your-pages-in-wordpress/ and either using your
functions.php
or a plugin to enable the excerpt editing box for pages.Jon
In reply to: How to move nav-menu dropdown image from left to right side?
September 15, 2011 at 11:33 am #17097Hi, well done on finding a solution. I have a suggestion to allow the theme to be updated without overwriting your changes. Create your own images for the arrows (perhaps even a child-sprite-master) rather than editing the main sprite master and then refer to that in your child theme css, that way it will not be overwritten by an update.
Hope this helps
Jon
They do a 32×32 pixel series of buttons if you want them big.
sorry, you may also need php tags around it. Put
<?php
in front of the block and?>
after the blockAre you using Breadcrumb NavXT for your breadcrumbs?
Yes as I put in the other thread I used action hooks and php in my
functions.php
.To add the suntimes I used
add_action('graphene_top_menu', 'wmrt_sun_times_display', 19);
and then wrote a function calledwmrt_sun_times_display
to do the output.This sort of thing will be much easier in graphene 1.5 where the theme options will give the ability to add code to action hooks without messing with a
functions.php
.I have had some problems getting facebook’s buttons to show too. How about using http://www.addthis.com buttons that seem to behave much better? You could probably use addthis for both the plus one and facebook buttons.
May be worth a shot if you can’t figure out what is happening to the facebook buttons.
Jon
This is something that I wanted to sort out for my site. Here is the code I added to my functions.php:
/******
* these next two remove the graphene breadcrumb and then add one
* which does not appear on the home page
*****/
// has to be called after the action is added
add_action ('after_setup_theme', 'wmrt_remove_graphene_bc');
function wmrt_remove_graphene_bc() {
remove_action ('graphene_top_content', 'graphene_breadcrumb_navxt');
}
add_action('graphene_top_content', 'wmrt_breadcrumb_navxt');
function wmrt_breadcrumb_navxt () {
//by calling this at this point is_home() works!
if ((function_exists('bcn_display')) && (!(is_home()))) {
echo '<div class="breadcrumb">';
bcn_display();
echo '</div>';
}
}I think this should give you the answer http://wordpress.org/support/topic/cant-rename-blogroll-widget
Jon