833 posts
  • Power Elite Author: Sold more than $1M on Envato Market
  • Won a competition
  • Made it to the Authors' Hall of Fame
  • Has sold $1M+ on Envato Market and is now a Power Elite Author
+8 more
wpbakery says

Hi guys, are there any method to display in the sidebar a page. But only a part which is before the <!- more -> tag? And also with images..So if I will put image before <!- more -> tag then it also should appear in the sidebar.php?

Thanks

352 posts
  • Has been part of the Envato Community for over 6 years
  • Has referred 50+ members
  • Has sold $10,000+ on Envato Market
  • Had an item featured in an Envato Bundle
+6 more
danharper says

Very easily :)


<?php /* allows us to use the more tag */
global $more;
$more = 0;

query_posts("page_id=PAGEIDHERE");
while(have_posts()) : the_post(); ?>

   <h2><?php the_title(); ?></h2>
   <?php the_content();

endwhile;

?>

Insert the ID of the page in place of PAGEIDHERE .

833 posts
  • Power Elite Author: Sold more than $1M on Envato Market
  • Won a competition
  • Made it to the Authors' Hall of Fame
  • Has sold $1M+ on Envato Market and is now a Power Elite Author
+8 more
wpbakery says
Very easily :)

<?php /* allows us to use the more tag */
global $more;
$more = 0;

query_posts("page_id=PAGEIDHERE");
while(have_posts()) : the_post(); ?>

   

<?php the_title(); ?>

<?php the_content();

endwhile;

?>

Insert the ID of the page in place of PAGEIDHERE .

I think I tried that already but it didn’t work for me.. I will try later again and will report about the results

352 posts
  • Has been part of the Envato Community for over 6 years
  • Has referred 50+ members
  • Has sold $10,000+ on Envato Market
  • Had an item featured in an Envato Bundle
+6 more
danharper says

Let me know what the problem is and I’ll see what I can do, since that code does work.

You may need to add this at the end of the block of code:

<?php wp_reset_query(); ?>

833 posts
  • Power Elite Author: Sold more than $1M on Envato Market
  • Won a competition
  • Made it to the Authors' Hall of Fame
  • Has sold $1M+ on Envato Market and is now a Power Elite Author
+8 more
wpbakery says

It’s me again… Image problem is solved. My bad. I left img tag in the page.php so I saw a image at the page, but I didn’t see it in the sidebar. Now img works… but it’s ignoring more tag… Full page is rendered at the sidebar.

Any clues?

352 posts
  • Has been part of the Envato Community for over 6 years
  • Has referred 50+ members
  • Has sold $10,000+ on Envato Market
  • Had an item featured in an Envato Bundle
+6 more
danharper says

Make sure you have:


global $more;
$more = 0;

in your sidebar, above where you include a page.

833 posts
  • Power Elite Author: Sold more than $1M on Envato Market
  • Won a competition
  • Made it to the Authors' Hall of Fame
  • Has sold $1M+ on Envato Market and is now a Power Elite Author
+8 more
wpbakery says
Make sure you have:

global $more;
$more = 0;

in your sidebar, above where you include a page.

100% I have it.

http://pastie.org/371257

833 posts
  • Power Elite Author: Sold more than $1M on Envato Market
  • Won a competition
  • Made it to the Authors' Hall of Fame
  • Has sold $1M+ on Envato Market and is now a Power Elite Author
+8 more
wpbakery says

3 days of fighting without luck :(

by
by
by
by
by
by