Social bookmark

(15 posts) (4 voices)

  1. Netipro
    Member

    Hello,

    Is there an easy way to set in infocus the exactly same social bookmarks at the end of every posts as those in perusasion ?

    Really like the persuasion one. (and as far as I know there isn't in the source folder the psd for sprite which ontains "Spread the world")

    Thanks

    Pascal

    Posted 4 months ago #
  2. Webtreats
    Support

    Hi Netipro,

    The social bookmark icons that you will need to swap are in this folder: "images/post_sociables/"

    You will also need to modify infocus' style.css

    Change lines 272-278 from:

    /* Share This Module
    -------------------------------------------------------------- */
    .share_this_module{margin-bottom:10px;padding:4px 25px;position:relative;background:url(images/share_this_bg.png) repeat-x 0 0 #e9e9e9;}
    .full_width .share_this_module{max-width:500px;}
    .share_this_title{position:absolute;text-indent:-99999px;background:url(images/sprite2.png) no-repeat -10px -68px #888;height:38px;top:10px;width:100px;}
    .share_this_content{padding-left:112px;height:50px;}
    .post_sociable{background:#888;}

    To:

    /* Share This Module
    -------------------------------------------------------------- */
    .share_this_module{float:right;margin-bottom:0;}
    .share_this_title{display:none;}
    .post_sociable{margin-right:5px;vertical-align:middle;}
    box-shadow: none !important;
    .share_this_title,.post_sociable{background:none!important;}
    Posted 4 months ago #
  3. Netipro
    Member

    Thanks a ton

    I'll give it a try tomorrow.

    Pascal

    Posted 4 months ago #
  4. Netipro
    Member

    Ok this hack works but

    I tried to find a way to add these changes in my infocus-child theme.

    So I've included my new sociable images in
    infocus-child/images/post-sociables/

    Add the new css lines you gave me in
    infocus-child/style.css

    And of course it doesn't work.
    I have to rename the infocus/images/post-sociables folder and copy my own one from my child theme
    I have to really update the infocus styles.css

    But I confirm you that if I do exactly what you told me then it works fine

    So to not have to redo this at every updates, is there a way to add these updates in a child theme ?

    Thanks for the tricks

    Pascal

    Posted 4 months ago #
  5. Netipro
    Member

    Well in fact it doesn't really work. We almost done, but here is the pbms

    some css class you gave me are not used with infocus (by default (without changing the code)

    .share_this_module --> Ok in both
    .share_this_title --> Ok in both (but in persuasion set to not shown, and I will show it in infocus? But ok not a pbm)
    .post_sociable --> ok in both

    but it"s missing
    .share_this_content

    Infocus use it like this for example :

    <div class="share_this_content">
       <a href="http://twitter.com/home?status=blablabla%20http://domain.fr/?p=1">
        <img alt="Twitter" class="post_sociable" src="http://domain.fr/wp-content/themes/infocus/images/post_sociables/twitter.png" />
       </a>

    So I have to create a share_this_content class

    Thanks
    ps: which markup do you use to show the code as you did in your post ?

    Posted 4 months ago #
  6. Elliott
    Support

    Hello Netipro,

    Send us a link to your page so we can see what you currently have setup.

    Posted 4 months ago #
  7. Netipro
    Member

    http://cardiopro.fr/bonjour-tout-le-monde/

    But in fact it's just missing .share_this_content which is used in inFocus and not in persuasion as you can see in the code example I gave you and taken from the html source file
    It's why the sociable icons are set at the really bottom (.share_this_content should help me to set the paddings, margin, etc)

    Posted 4 months ago #
  8. Elliott
    Support

    Try adding this in Dashboard -> your theme -> General Settings -> Custom CSS,

    .share_this_module { position: relative; top: -20px; }

    Posted 4 months ago #
  9. Netipro
    Member

    Ok with your help I finaly get it works like I expected it should be (for me)

    In my child theme I've set in the styles.css the Share This Module css like this

    * Share This Module
    -------------------------------------------------------------- */
    .share_this_module{float:right;margin-bottom:0;background:none!important;box-shadow: none !important;}
    .share_this_title{display:none;}
    .share_this_content{position:relative;top:-40px;}
    .post_sociable{margin-right:5px;vertical-align:middle;}
    .share_this_title,.post_sociable{background:none!important;}

    It works great, as you can see here :
    http://cardiopro.fr/bonjour-tout-le-monde/

    but the only pbm I can see is that I had to change the images files in the "post_sociables" folder
    I played around to see if there were an easy way to change this folder by one in my child theme
    What I learned is that there is a function that set these images path. It seems to be
    mysite_sociable_bookmarks()

    And it looks like it is not possible to set it in a child theme like this. Indeed there is no

    "if ( !function_exists ('mysite_sociable_bookmarks'))

    But I found that this function is called in a child theme ready function "mysite_post_sociables"

    if ( !function_exists( 'mysite_post_sociables' ) ) :
    /**
     *
     */
    function mysite_post_sociables() {
    	$out = '';
     
    	$social_bookmarks = mysite_get_setting( 'social_bookmarks' );
    	$social_bookmarks_post = get_post_meta( get_the_ID(), '_disable_social_bookmarks', true );
     
    	if( empty( $social_bookmarks ) && empty( $social_bookmarks_post ) ) {
    		$out .= '<div class="share_this_module">';
     
    		$out .= '<h3 class="share_this_title">' . __( 'Share this:', MYSITE_TEXTDOMAIN ) . '</h3>';
     
    		$out .= '<div class="share_this_content">';
     
    		$out .= mysite_sociable_bookmarks();
     
    		$out .= '</div><!-- .share_this_content -->';
    		$out .= '</div><!-- .share_this_module -->';
    	}
     
    	echo apply_filters( 'mysite_post_sociables', $out );
    }
    endif;

    So the idea is to set this function in my functions.php child theme and then replace the line

    $out .= mysite_sociable_bookmarks();

    by the contents of mysite_sociable_bookmarks and then replace there new post_sociables images path folder to use one in my child theme

    So create mysite_post_sociables in my child theme functions.php
    And replace

                   .../...
    		$out .= '<div class="share_this_content">';
    		$out .= mysite_sociable_bookmarks();
    		$out .= '</div><!-- .share_this_content -->';
                  .../...

    by

                .../...
    		$out .= '<div class="share_this_content">';
    		  // thez modified contents of mysite_sociable_bookmarks() here
    			$sociable_sites = array(
     
    				array( "name" => "Twitter",
    					'icon' => './images/post_sociables/twitter.png',
    					'class' => 'twitter_icon',
    					'url' => 'http://twitter.com/home?status=TITLE%20-%20PERMALINK',
    				),
                   etc
    		.../...
     
    		$out .= '</div><!-- .share_this_content -->';

    Do you think it is the right way or it there an easyer and/or a more modular way of doing this ?
    Indeed I don't like include the modified function source rahter than call one

    The goal is just to set the updated post_sociables images in the child theme and not update the original ones

    But in all cases thanks a lot for your precious help

    Posted 4 months ago #
  10. Netipro
    Member

    It'd be really cool to be able to include the mysite_sociable_bookmarks() function in the child theme. Indeed, the main default of the existing one is that the a href opens a link in the same window and not in a new one. So it lets the users quit our website, which is never good !

    So if we are able to change the mysite_sociable_bookmarks() function, then we'll be able to
    1- change the icon directory used,
    2- change the link to let us open a new window.
    3- and finally the other main advantage is that we will also be able to add/update/modify the icons shown there (for example add google+)

    It looks like a class is used for every icons in this function, but never defined in css (ie twitter_icon, facebook_icon....)

    Thanks by advance

    Posted 4 months ago #
  11. Elliott
    Support

    I'll move this to feature requests and we'll see if we can get the function check added in the next update.

    As an alternative you can also use our hooks to add your sociables to the end of the post, http://mysitemyway.com/docs/index.php/Using_Child_Themes#Actions_and_Hooks.

    The hook I think your wanting is called, "mysite_singular-post_after_post".

    Posted 4 months ago #
  12. Netipro
    Member

    Ok thanks a lot Elliot. I'll have a look at this

    Posted 4 months ago #
  13. Netipro
    Member

    The hooks work fine indeed as you can see here for example :

    http://cardiopro.fr/bonjour-tout-le-monde/

    I've also added in my child theme the .mysite_sociable which allow me to show only the sociable hooks and disable the default sociable

    /* Social Media
    -------------------------------------------------------------- */
    .mysite_sociable{float:left;margin-right:20px;margin-top:-10px;margin-bottom:35px;}
    Posted 4 months ago #
  14. When migrating the site from the dev server to the production server, we found an interesting issue:

    it seems as though the "Spread the Word" code has the old dev server URL hard coded, rather than a relative link. Needless to say it is sort of embarrassing...especially since the client wants us to fix it and we haven't a clue where to find the code.

    Search all over and it is not in any documentation we can find.

    Any thoughts? I figure something in functions.php or admin.php.

    Posted 2 months ago #
  15. Elliott
    Support

    Hello dsbrooks,

    Did you make sure to change your site URL? Send us a link to your page.

    Posted 2 months ago #

Reply

You must log in to post.

Construct WordPress Theme
Construct wordpress theme
Myriad WordPress Theme
Myriad wordpress theme
Method WordPress Theme
Method wordpress theme
Fusion WordPress Theme
Fusion wordpress theme
Elegance WordPress Theme
Elegance wordpress theme
Echelon WordPress Theme
Echelon wordpress theme
Dejavu WordPress Theme
Dejavu wordpress theme
Modular WordPress Theme
Modular wordpress theme