<!--more--> being ignored when WordPress content is displayed -


I am trying to write a plugin that will take page ID and return a preview of the page. Here is my code:

  function page_preview ($ atts, $ pageid = null) {citations (shortcode_atts (array ("pidid" => gt; '$', $ atts)); $ The_query = New WP_Query ('page_id ='. $ Pageid. ''); Global $ more; $ More = 0; If ($ the_query-> is_pause ()) {while ($ the_query-> is_pos ()) {$ the_query-> The_post (); $ Title = get_the_title (); $ Thumbnail = get_the_post_thumbnail ($ page id, 'preview'); $ Content = get_the_content (); }} Return '& lt; Div class = "callout" & gt; . '& Lt; H4 & gt; ' . $ Heading '& lt; / H4 & gt; ' . $ Thumbnail $ content '& lt; A href = "'. Get_the_permalink ($ page ID)." & Gt; Continue reading & lt; / A & gt; & Lt; / Div & gt; '; } Add_shortcode ('Page Preview', 'Page_preview');  

And it's called as soon as on the wpadmin editor: [Page Preview Page Page = 11] [Page Forecast PageId = 13] [Page Preview PageID = 8054] i.e. Those page IDs will display a page preview for each.

"more" does not work

  global $ more; $ More = 0;  

Usually this solves the problem, but it's not in my case. Can anyone see what I am doing? Thank you.

You are receiving the full content because

$ content = Get_the_content ();

is not implementing the_content () filter, and should be on line after $$ = 0 $ The_query-> The_post (); while inside while while loop Change the loop in its time:

  while ($ The_query-> is_posts ()) {$ the_query-> The_post (); $ More = 0; $ Title = get_the_title (); $ Thumbnail = get_the_post_thumbnail ($ pageid, 'preview'); $ Content = apply_filters ('$ Content = str_replace (']] ',', ']] gt;', $ content;}}  

and for codecs on WordPress Where I have solved it.


Comments

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

c# - MySQL Parameterized Select Query joining tables issue -