Jump to content

Releated Games instead of (How to Play)


Johnmayer

Recommended Posts

Hi there ,
Have a game Website and when you click on gamepage standart will show How to Play TAB.

skug6a.jpg

But I want to show Releated Games TAB

315zfv7.jpg

The Code :

 

 

<div class="toppad"></div>
<div class="tabs-wrapper">
<ul class="tabs" style="width: 982px;">

<?php if(get_option('tigu_howtoplay') == 'true'): ?>
<li>
<a href="#tab1"><?php _e('How to play', 'Gameleon'); ?></a>
</li>
<?php endif; ?>

<?php if(get_option('tigu_post_tags') == 'true'): ?>
<li class="">
<a href="#tab2"><?php _e('Tags', 'Gameleon'); ?></a>
</li>
<?php endif; ?>

<?php if(get_option('tigu_related') == 'true'): ?>
<li class="">
<a href="#tab3">
<?php if(get_option('tigu_related_title_games') == 'Related [Category Title] Games'): ?>
<?php _e('Related', 'Gameleon'); ?> <?php $category = get_the_category($post->ID); echo $category[0]->cat_name; ?> <?php _e('Games', 'Gameleon'); ?>
<?php else: ?>
<?php _e('Related Games', 'Gameleon'); ?>
<?php endif; ?>
</a>
</li>
<?php endif; ?>
<?php if( is_myarcade_game() ): ?>
<?php if(get_option('tigu_embed_tab') == 'true'): ?>
<li class=""> 
<a href="#tab4"><?php _e('Embed', 'Gameleon'); ?></a>
</li>
<?php endif; ?>
<?php endif; ?>

<?php if ( (get_option('tigu_dispay_screenshots') == 'true') && myarcade_count_screenshots() ): ?>
<li class=""> 
<a href="#tab5"><?php _e('Game Screenshots', 'Gameleon'); ?></a>
</li>
<?php endif; ?>

<?php if(get_option('tigu_custom_tab') == 'true'): ?>
<li class=""> 
<a href="#tab6"><?php echo get_option('tigu_custom_tab_title', 'Custom Tab'); ?></a>
</li>
<?php endif; ?>

</ul>

<?php if(get_option('tigu_howtoplay') == 'true'): ?>
<div id="tab1" class="tab_content" style="display:block;">
<div class="instructions post-entry">
<?php echo do_shortcode($instructions); ?>
</div>
</div>
<?php endif; ?>

<?php if(get_option('tigu_post_tags') == 'true'): ?>
<?php if(get_option('tigu_howtoplay') == 'false'): ?>
<div id="tab2" class="tab_content" style="display:block;">
<?php else: ?>
<div id="tab2" class="tab_content" style="display:none;">
<?php endif; ?>
<div class="gamepage" style="padding-bottom:12px !important; padding-left:13px !important">
<p class='tag_cloud'><?php the_tags(' ',' '); ?></p>
</div>
</div>
<?php endif; ?>


<!-- START DISPLAY RELATED GAMES BY TAGS -->
<?php if (get_option('tigu_related_display_by', 'Related Games by Tags') == 'Related Games by Tags'): ?>

<?php $related = get_related_games($post->ID); ?>

<?php if($related->have_posts() && $related->found_posts >= 3 && get_option('tigu_related') == 'true'): ?>

<?php if(get_option('tigu_howtoplay') == 'false' && get_option('tigu_post_tags') == 'true'): ?> 
<div id="tab3" class="tab_content" style="display:none;">
<?php endif; ?>

<?php if(get_option('tigu_howtoplay') == 'true' && get_option('tigu_post_tags') == 'false'): ?> 
<div id="tab3" class="tab_content" style="display:none;">
<?php endif; ?>

<?php if(get_option('tigu_howtoplay') == 'false' && get_option('tigu_post_tags') == 'false'): ?> 
<div id="tab3" class="tab_content" style="display:block;">
<?php endif; ?>
 
<?php if(get_option('tigu_howtoplay') == 'true' && get_option('tigu_post_tags') == 'true'): ?> 
<div id="tab3" class="tab_content" style="display:none;">
<?php endif; ?>


<div class="gamepage">

<?php while($related->have_posts()): $related->the_post(); ?>
<?php if(has_post_thumbnail() || is_myarcade_game() ): ?>
<?php
if(has_post_format('video') || has_post_format('audio') || has_post_format('gallery')) {
$icon = '<span class="' . get_post_format($post->ID) . '-icon"></span>';
} else {
$icon = '';
}
?>
<?php $image = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'related-thumb'); ?>
<?php if ( empty($image[0]) ) $image[0] = myarcade_get_thumbnail_url(); ?>
<div class="related-games block">
<?php echo $icon; ?>
<a class="hover_play_small tooltip" href='<?php the_permalink(); ?>' title='<?php the_title(); ?>'>
<img src="<?php echo $image[0]; ?>" width="81" height="60" alt="<?php the_title(); ?>" />
</a>
</div>
<?php else: ?>
<div class="related-games block">
<a class="hover_play_small" href='<?php the_permalink(); ?>' title='<?php the_title(); ?>'>
<img src="<?php echo get_template_directory_uri(); ?>/images/thumbnail-76.png" width="81" height="60" alt="<?php the_title(); ?>" />
</a>
</div>
<?php endif; ?>
<?php endwhile; ?>
</div>
</div>
<?php endif; ?>

<!-- END DISPLAY RELATED GAMES BY TAGS -->

<?php else: ?>

<!-- START DISPLAY RELATED GAMES BY CATEGORY -->

<?php if(get_option('tigu_related') == 'true'): ?>

<?php if(get_option('tigu_howtoplay') == 'false' && get_option('tigu_post_tags') == 'true'): ?> 
<div id="tab3" class="tab_content" style="display:none;">
<?php endif; ?>

<?php if(get_option('tigu_howtoplay') == 'true' && get_option('tigu_post_tags') == 'false'): ?> 
<div id="tab3" class="tab_content" style="display:none;">
<?php endif; ?>

<?php if(get_option('tigu_howtoplay') == 'false' && get_option('tigu_post_tags') == 'false'): ?> 
<div id="tab3" class="tab_content" style="display:block;">
<?php endif; ?>
 
<?php if(get_option('tigu_howtoplay') == 'true' && get_option('tigu_post_tags') == 'true'): ?> 
<div id="tab3" class="tab_content" style="display:none;">
<?php endif; ?>


<div class="gamepage">

<?php
$categories = get_the_category($post->ID);
if ($categories) {
$category_ids = array();
foreach($categories as $individual_category) $category_ids[] = $individual_category->term_id;
$args=array(
        'category__in' => $category_ids,
        'post__not_in' => array($post->ID),
 
    //  'post__not_in' => array( get_the_ID() ),
 
        'showposts'=>10,
        'caller_get_posts'=>1
    );
    $my_query = new wp_query($args);
    if( $my_query->have_posts() ) {
         
      
        while ($my_query->have_posts()) {
            $my_query->the_post();
        ?>

 <?php if(has_post_thumbnail() || is_myarcade_game() ): ?>
<?php
if(has_post_format('video') || has_post_format('audio') || has_post_format('gallery')) {
$icon = '<span class="' . get_post_format($post->ID) . '-icon"></span>';
} else {
$icon = '';
}
?>
<?php $image = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'related-thumb'); ?>
<?php if (empty($image[0]) ) $image[0] = myarcade_get_thumbnail_url(); ?>
<div class="related-games block">
 
<a class="hover_play_small tooltip" href='<?php the_permalink(); ?>' title='<?php the_title(); ?>'>
<img src="<?php echo $image[0]; ?>" width="81" height="60" alt="<?php the_title(); ?>" />
</a>
</div>
<?php else: ?>
<div class="related-games block">
<a class="hover_play_small" href='<?php the_permalink(); ?>' title='<?php the_title(); ?>'>
<img src="<?php echo get_template_directory_uri(); ?>/images/thumbnail-76.png" width="81" height="60" alt="<?php the_title(); ?>" />
</a>
</div>
<?php endif; ?>
<?php
        }
         
    }
}
?>
</div>
</div>
<?php endif; ?>
<?php endif; ?>

<!-- END DISPLAY RELATED GAMES BY CATEGORY -->

<?php if (function_exists('get_game')): ?>
<?php if(get_option('tigu_embed_tab') == 'true'): ?>
<div id="tab4" class="tab_content" style="display:none;">
<div class="instructions">

<form name="select_all" class="formembed">
<textarea class="formembedtext" name="text_area" onClick="javascript:this.form.text_area.focus();this.form.text_area.select();">
<?php if (function_exists('get_game')): ?><?php echo get_game($mypostid); ?>
<?php else: ?>
<?php echo get_game($post->ID); ?>
<?php endif; ?>
<?php if(get_option('tigu_embed_text')): ?>
<?php echo do_shortcode( stripslashes( get_option( 'tigu_embed_text' ) ) ); ?>
</div>
<?php endif; ?>
</textarea>
</form>
</div>
</div>
<?php endif; ?>
<?php endif; ?>

<?php if ( (get_option('tigu_dispay_screenshots') == 'true') && myarcade_count_screenshots() ): ?>
<div id="tab5" class="tab_content" style="display:none;">
<div class="gamepage">
<div class="block">
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
 <?php myarcade_all_screenshots(81, 60, 'gamescreenshots'); ?>
<?php endwhile; endif; ?>
</div>
</div>
</div>
<?php else: ?>
<div id="tab5" class="tab_content" style="display:none;">
<div class="gamepage">
<div class="block">
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
 <?php myarcade_all_screenshots(81, 60, 'gamescreenshots'); ?>
<?php endwhile; endif; ?>
</div>
</div>
</div>
<?php endif; ?>

<?php if(get_option('tigu_custom_tab') == 'true'): ?>
<div id="tab6" class="tab_content" style="display:none;">
<div class="instructions">
<?php echo do_shortcode( stripslashes( get_option( 'tigu_custom_tab_code' ) ) ); ?>
</div>
</div>
<?php endif; ?>

</div>

 

 

Please help ! THX

Link to comment
Share on other sites

Thx for replay. As you can see on the pictures the TAB`s is showing but standart show the content of (How to Play) . I want Releated Games show by Standart like second picture. And there are no settings in MyArcadePlugin or Tigu, thats why I send the Code snippet.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.