Visite ai post in WPtouch Mobile Plugin

Tra i plugin che consentono al nostro sito web di diventare adatti ad una visualizzazione su dispositivi mobili, quello che ritengo essere il migliore per i siti sotto WordPress è WPtouch Mobile Plugin. Tra le opzioni consentite, c’è quella di poter visualizzare in fondo al post le categorie di appartenenza e i tag di competenza, ma non c’è modo tramite il plugin di inserire anche le visite ricevute dal post.

Ecco perché, anche dopo aver scritto sul forum di WordPress, ho modificato (partendo da un suggerimento dei proprietari del plugin) il file

wp/wp-content/plugins/wptouch/themes/bauhaus/default/single.php

inserendo nel codice originale quanto sotto riportato evidenziato

	<div id="content">
		<?php while ( wptouch_have_posts() ) { ?>

			<?php wptouch_the_post(); ?>

			<div class="<?php wptouch_post_classes(); ?>">
				<div class="post-page-head-area bauhaus">
					<span class="post-date-comments">
						<?php if ( bauhaus_should_show_date() ) { ?>
							<?php wptouch_the_time(); ?>
						<?php } ?>
						<?php if ( bauhaus_should_show_comments() ) { ?>
							<?php if ( bauhaus_should_show_date() && ( comments_open() || wptouch_have_comments() ) ) echo '&bull;'; ?>
							<?php if ( comments_open() || wptouch_have_comments() ) comments_number( __( 'no comments', 'wptouch-pro' ), __( '1 comment', 'wptouch-pro' ), __( '% comments', 'wptouch-pro' ) ); ?>
						<?php } ?>
					</span>
					<h1 class="post-title heading-font"><?php wptouch_the_title(); ?></h1>
					<?php if ( bauhaus_should_show_author() ) { ?>
						<span class="post-author"><?php the_author(); ?></span>
					<?php } ?>
					<?php if ( bauhaus_should_show_thumbnail() && wptouch_has_post_thumbnail() ) { ?>
						<div class="post-page-thumbnail">
							<?php the_post_thumbnail('large', array( 'class' => 'post-thumbnail wp-post-image' ) ); ?>
						</div>
					<?php } ?>
				</div>

				<div class="post-page-content">
					<?php wptouch_the_content(); ?>
					<?php if ( bauhaus_should_show_taxonomy() ) { ?>
						<?php if ( wptouch_has_categories() || wptouch_has_tags() ) { ?>
							<div class="cat-tags">
								<?php if ( wptouch_has_categories() ) { ?>
									<?php _e( 'Categories', 'wptouch-pro' ); ?>: <?php wptouch_the_categories(); ?><br />
								<?php } ?>
								<?php if ( wptouch_has_tags() ) { ?>
									<?php _e( 'Tags', 'wptouch-pro' ); ?>: <?php wptouch_the_tags(); ?>
								
								<!-- rows added by MZ -->
									<br />
								<!-- end -->
								
								<?php } ?>
								
								<!-- rows added by MZ -->
								<?php if(function_exists('the_views')) { 
									$visite = the_views(false);
									$visite = str_replace(" visite","", $visite);
									echo "Visite: ".$visite; } ?>
								<!-- end -->
								
							</div>
						<?php } ?>
					<?php } ?>
				</div>
			</div>

		<?php } ?>
	</div> <!-- content -->

così che il numero di visite del post fosse visualizzato dopo categorie e tag. Il codice non ha bisogno di particolari commenti, ed il risultato lo potete vedere nello screenshot qui sotto relativo alla pagina web dell’articolo Plugin utilizzati.

wp_ss_20151025_0003

Lascia un commento