Tagged: x
-
AuthorPosts
-
November 28, 2016 at 11:52 am #1273477
chrishdunnParticipantHi…I’ve no doubt missing something simple, but can’t get shortcodes working in my posts … here’s an example … http://edgazette.co.uk/uncategorized/prp/
Am using this code in my content-the-content.php file …
<?php // ============================================================================= // VIEWS/GLOBAL/_CONTENT-THE-CONTENT.PHP // ----------------------------------------------------------------------------- // Display of the_content() for various entries. // ============================================================================= ?> <?php function get_last_words($amount, $string) { $amount+=1; $string_array = explode(' ', $string); $totalwords= str_word_count($string, 1, 'xxxx'); if($totalwords > $amount){ $words= implode(' ',array_slice($string_array, count($string_array) - $amount)); }else{ $words= implode(' ',array_slice($string_array, count($string_array) - $totalwords)); } return $words; } ?> <?php do_action( 'x_before_the_content_begin' ); ?> <div class="entry-content content"> <?php do_action( 'x_after_the_content_begin' ); ?> <? if ( is_singular('post') ) { if (in_category('news-in-a-nutshell') OR in_category('shrektheteacher') OR in_category('uncategorized') OR in_category('the-editor')) { echo get_the_content(); } else { $postlength = 600; //if (strlen(get_the_content()) < $postlength) { //echo get_the_content(); //} if ($linkpos = strpos(prefix_me_truncate(get_the_content(),$postlength),'<div class="edgpostlink">',1) > 0) { echo get_the_content(); } else { echo prefix_me_truncate(get_the_content(),$postlength); $linkpos = strpos(get_the_content(),'<div class="edgpostlink">',1) ; echo substr(get_the_content(), $linkpos, $linkpos + 100); } } // echo do_shortcode ('[shareaholic app="share_buttons" id="21693601"]'); echo sharing_display(); // echo do_shortcode ('[shareaholic app="recommendations" id="21693609"]'); ?> <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> <!-- edgresponsivehoz --> <ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-2214146753628542" data-ad-slot="9441017351" data-ad-format="auto"></ins> <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script> <?php wp_related_posts(); // echo do_shortcode('[jetpack-related-posts]'); } else { the_content(); } ?> <?php x_link_pages(); ?> <?php do_action( 'x_before_the_content_end' ); ?> </div> <?php //Do the below to trigger the Top 10 plugin hit counter. Hide the class in css. echo tptn_add_viewed_count( ' ' ); ?> <?php do_action( 'x_after_the_content_end' ); ?>Would be grateful if you can give me some pointers … Thanks.
November 28, 2016 at 12:13 pm #1273493
NicoModeratorHi There,
Would you mind sharing us details of what you want to achieve and please share us your admin credentials and FTP so we could check your setup further.
Don’t forget to set it as private reply.
Thanks.
December 14, 2016 at 5:25 pm #1293471
chrishdunnParticipantThanks, managed to achieve what I needed by using a page instead of a post.
Chris.
December 14, 2016 at 9:38 pm #1293742
Prasant RaiModeratorYou are most welcome. 🙂
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1273477 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
