Welcome to PressWork!

Want to ask a question or join the discussion? Great! Join now.

In this Discussion

Rearranging Content in Sidebar
  • I've used the suggestions here on this site to place my social media icons at the top of my sidebar.

    My question is how can I add things above my social media icons?

    I'm going to be releasing an e-book on my site soon and I'd like to display a graphic above my social media icons linking to my e-book.

    Thanks for the help!
  • Just include it first in your previous function that you hooked to pw_sidebar_top
    image PressWork Support Moderator
  • I'm still not sure where and how to add it. I understand that it goes in the custom-actions.php file, but I'm not sure where and the coding needed.

    I tried adding an "img src..." tag, but that didn't work.

    Here is what's in my custom-actions.php file:
    <?php
    remove_action('pw_header_top', 'pw_social_content');
    function my_pw_social_content() {
    $twitter = pw_theme_option('twitter');
    $facebook = pw_theme_option('facebook');
    $flickr = pw_theme_option('flickr');
    $linkedin = pw_theme_option('linkedin');
    $googleplus = pw_theme_option('googleplus');
    $stumbleupon = pw_theme_option('stumbleupon');
    echo '<div id="aside-social-icons" class="side-widget">';
    echo '<h4> </h4>';
    if(!empty($twitter))
    echo '<a href="https://twitter.com/'.$twitter.'" class="twitter-icon"></a>';
    if(!empty($facebook))
    echo '<a href="https://facebook.com/'.$facebook.'" class="facebook-icon"></a>';
    if(!empty($flickr))
    echo '<a href="https://www.flickr.com/photos/'.$flickr.'" class="flickr-icon"></a>';
    if(!empty($googleplus))
    echo '<a href="https://plus.google.com/'.$googleplus.'" class="googleplus-icon"></a>';
    if(!empty($linkedin))
    echo '<a href="https://www.linkedin.com/in/'.$linkedin.'" class="linkedin-icon"></a>';
    if(!empty($stumbleupon))
    echo '<a href="https://www.stumbleupon.com/stumbler/'.$stumbleupon.'" class="stumbleupon-icon"></a>';
    //Feed link below
    echo '<a href="https://warriordave.com/feed/'.$rss.'" class="feed-icon"></a>';
    echo '</div>';
     
    }
    add_action('pw_sidebar_top', 'my_pw_social_content');?>


    Sorry, I don't know how to do the cool box thing where you show the code.
    Post edited by cestbibi at 2012-02-03 05:23:40
  • Be minded that if you are using PW 1.0.4 (ONLY) you'll need this now:
    instead of :
    remove_action('pw_header_top', 'pw_social_content');


    NOW
    remove_action('pw_header_middle', 'pw_social_content');


    As for your question, better than the first solution I gave you just do this :
    function display_my_ebook() {
    // HERE the html path to your image
    }
    add_action('pw_sidebar_top', 'display_my_ebook');
     
    // Then follows your previous function for Social icons
     
    remove_action('pw_header_middle', 'pw_social_content');
    function my_pw_social_content() {
    $twitter = pw_theme_option('twitter');
    $facebook = pw_theme_option('facebook');
    $flickr = pw_theme_option('flickr');
    $linkedin = pw_theme_option('linkedin');
    $googleplus = pw_theme_option('googleplus');
    $stumbleupon = pw_theme_option('stumbleupon');
    echo '<div id="aside-social-icons" class="side-widget">';
    echo '<h4> </h4>';
    if(!empty($twitter))
    echo '<a href="https://twitter.com/'.$twitter.'" class="twitter-icon"></a>';
    if(!empty($facebook))
    echo '<a href="https://facebook.com/'.$facebook.'" class="facebook-icon"></a>';
    if(!empty($flickr))
    echo '<a href="https://www.flickr.com/photos/'.$flickr.'" class="flickr-icon"></a>';
    if(!empty($googleplus))
    echo '<a href="https://plus.google.com/'.$googleplus.'" class="googleplus-icon"></a>';
    if(!empty($linkedin))
    echo '<a href="https://www.linkedin.com/in/'.$linkedin.'" class="linkedin-icon"></a>';
    if(!empty($stumbleupon))
    echo '<a href="https://www.stumbleupon.com/stumbler/'.$stumbleupon.'" class="stumbleupon-icon"></a>';
    //Feed link below
    echo '<a href="https://warriordave.com/feed/'.$rss.'" class="feed-icon"></a>';
    echo '</div>';
     
    }
    add_action('pw_sidebar_top', 'my_pw_social_content');?>

    .
    image PressWork Support Moderator
  • I'm still using PW 1.03 due to all the issues with the new WordPress. In fact, I still haven't upgraded to WordPress 3.3.1 due to the issues I've read about with PW.

    I'm still not getting the image to show up. Here is what I have:
     function display_my_ebook() {// <img src="https://path to my picture here.jpg"/>
    }
    add_action('pw_sidebar_top', 'display_my_ebook');


    Thanks for all the help cestbibi!!!
    Post edited by Zodin at 2012-02-03 12:14:17
  • cestbibicestbibi
    This answer was Accepted.
    You can find PW 1.0.4 final here: https://github.com/digibomb/PressWork
    Just download and unzip the file and replace the presswork folder in your server (../wp-content/themes)
    It solves all the problems with WP 3.3.1

    Because we are in a .php file we need to have a special marking to insert the html, so it would be :
    function my_image() {
    echo '<img src="https://whatever_the_path_to_your_image" width="100" height="100" alt="ebook" />';
    }
    add_action('pw_sidebar_top', 'my_image');


    Adjust height and width to your needs.
    image PressWork Support Moderator
  • Awesome cestbibi, that worked! Thank you so much for all the help!!!

    I would assume if I wanted to place other things above the social media icons, the order of the functions in the php file is how that's done. One of the other things I'd like to add is a "First Time Here?" graphic that links to a page of the same name. If I wanted that to go between my e-book and the social media icons, I would place that accordingly in the php file correct?

    Next step is to start the update process with PW and WP. I've been delaying it for so long cause of the problems PW was having with it.
  • Zodin said:


    One of the other things I'd like to add is a "First Time Here?" graphic that links to a page of the same name. If I wanted that to go between my e-book and the social media icons, I would place that accordingly in the php file correct?



    Correct, at some point if you stack things up you might need to introduce some CSS to style things so they look better.

    image PressWork Support Moderator