How to move social share icons

January 2013 WordPress Theme
GK User
Sun Feb 24, 2013 3:31 pm
How to move social share icons from bottom of page to top and how to get theme be vissible in category and tag and author view after any post - inside readmore key?


[img]http://sport.mamywas.pl/wp-content/uploads/2013/02/Namnlös.png[/img]
User avatar
Fresh Boarder

GK User
Sun Feb 24, 2013 8:34 pm
Hi,

To move the social icons you have to open file layouts/content.post.footer.php and move this fragment:

Code: Select all
<?php if(is_singular()) : ?>
   <?php
      // variable for the social API HTML output
      $social_api_output = gk_social_api(get_the_title(), get_the_ID());
   ?>
   
   <?php if($social_api_output != ''): ?>
   <footer>
      <?php echo $social_api_output; ?>
   </footer>
   <?php endif; ?>
<?php endif; ?>


changed to this form:

Code: Select all
<?php if(is_singular()) : ?>
   <?php
      // variable for the social API HTML output
      $social_api_output = gk_social_api(get_the_title(), get_the_ID());
   ?>
   
   <?php if($social_api_output != ''): ?>
   <?php echo $social_api_output; ?>
   <?php endif; ?>
<?php endif; ?>


(in order to remove the unnecessary in this case footer element) to file: layouts/content.post.header.php

Adding the social icons in other pages is not supported by this theme and needs deeper changes in the theme's code which are beyond our non-VIP technical support.
User avatar
Administrator

GK User
Mon Mar 11, 2013 4:13 pm
thanks a lot but share icons are still on the footer, after removing foter tag.
User avatar
Fresh Boarder

GK User
Mon Mar 11, 2013 4:20 pm
what i did is copy this bit of code
Code: Select all
<?php if(is_singular()) : ?>
   <?php
      // variable for the social API HTML output
      $social_api_output = gk_social_api(get_the_title(), get_the_ID());
   ?>
   
   <?php if($social_api_output != ''): ?>
   
      <?php echo $social_api_output; ?>
   
   <?php endif; ?>
<?php endif; ?>


from content.post.footer.php into content.post.header.php, but i need some help... look on the post...on http://www.sport.mamywas.pl
i get this - 2> - after each title in category wiev and this - 1> - in post wiew.. and share icons are not really beaty...
User avatar
Fresh Boarder

GK User
Mon Mar 11, 2013 6:02 pm
Most probably you have pasted the code in the wrong place - please paste your whole content.post.header.php file here, then I'll analyze it.
User avatar
Administrator

GK User
Mon Mar 11, 2013 9:48 pm
Content post header php

Code: Select all
<?php

/**
 *
 * The template fragment to show post header
 *
 **/

// disable direct access to the file   
defined('GAVERN_WP') or die('Access denied');

global $tpl;

?>
<?php if(is_singular()) : ?>
   <?php
      // variable for the social API HTML output
      $social_api_output = gk_social_api(get_the_title(), get_the_ID());
   ?>
   
   <?php if($social_api_output != ''): ?>
   
      <?php echo $social_api_output; ?>
   
   <?php endif; ?>
<?php endif; ?>

<?php if(get_the_title() != '') : ?>
<h<?php echo (is_single()) ? '1' : '2'; ?>>
   <?php if(!is_singular()) : ?>
   <a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', GKTPLNAME ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark">
   <?php endif; ?>
      <?php the_title(); ?>
   <?php if(!is_singular()) : ?>
   </a>
   <?php endif; ?>
   
   <?php if(is_sticky()) : ?>
   <sup>
      <?php _e( 'Featured', GKTPLNAME ); ?>
   </sup>
   <?php endif; ?>
</h><?php echo (is_single()) ? '1' : '2'; ?>>
<?php endif; ?>

<?php if((!is_page_template('template.fullwidth.php') && ('post' == get_post_type() || 'page' == get_post_type())) && get_the_title() != '') : ?>
   <?php if(!(is_page() && get_option($tpl->name . '_template_show_details_on_pages', 'Y') == 'N')) : ?>
   <?php gk_post_meta(); ?>
   <?php endif; ?>
<?php endif; ?>

<?php do_action('gavernwp_before_post_content'); ?>

User avatar
Fresh Boarder

GK User
Tue Mar 12, 2013 11:11 am
Your problem is connected with fact that you have:

Code: Select all
</h><?php echo (is_single()) ? '1' : '2'; ?>>


instead of original:

Code: Select all
</h<?php echo (is_single()) ? '1' : '2'; ?>>
User avatar
Administrator

GK User
Tue Mar 12, 2013 11:53 am
i restore content.post.header.php into a original file and problem are still...

Code: Select all
<?php

/**
 *
 * The template fragment to show post header
 *
 **/

// disable direct access to the file   
defined('GAVERN_WP') or die('Access denied');

global $tpl;

?>

<?php if(get_the_title() != '') : ?>
<h<?php echo (is_single()) ? '1' : '2'; ?>>
   <?php if(!is_singular()) : ?>
   <a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', GKTPLNAME ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark">
   <?php endif; ?>
      <?php the_title(); ?>
   <?php if(!is_singular()) : ?>
   </a>
   <?php endif; ?>
   
   <?php if(is_sticky()) : ?>
   <sup>
      <?php _e( 'Featured', GKTPLNAME ); ?>
   </sup>
   <?php endif; ?>
</h><?php echo (is_single()) ? '1' : '2'; ?>>
<?php endif; ?>

<?php if((!is_page_template('template.fullwidth.php') && ('post' == get_post_type() || 'page' == get_post_type())) && get_the_title() != '') : ?>
   <?php if(!(is_page() && get_option($tpl->name . '_template_show_details_on_pages', 'Y') == 'N')) : ?>
   <?php gk_post_meta(); ?>
   <?php endif; ?>
<?php endif; ?>

<?php do_action('gavernwp_before_post_content'); ?>
User avatar
Fresh Boarder

GK User
Tue Mar 12, 2013 12:16 pm
So you have a bug in your packages, because I've downloaded the quickstart and the theme package and in both packages the file is correct.
User avatar
Administrator

GK User
Tue Mar 12, 2013 2:15 pm
OK.. i taked now from quickinstall and now file is correct.. before i use one from temlate...
Thanks a lot
I use share icons code and past it at the end of before.php.. Its ok..
Maybe you can do something to next realese nothing more flexible... :D
User avatar
Fresh Boarder


cron