834 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
+7 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 .

834 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
+7 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(); ?>

834 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
+7 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.

834 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
+7 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

834 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
+7 more
wpbakery says

3 days of fighting without luck :(

Helpful Information

  • Please read our community guidelines. Self promotion and discussion of piracy is not allowed.
  • Open a support ticket if you would like specific help with your account, deposits or purchases.
  • Item Support by authors is optional and may vary. Please see the Support tab on each item page.

Most of all, enjoy your time here. Thank you for being a valued Envato community member.

Post Reply

Format your entry with some basic HTML. Read the Full Details, or here is a refresher:

<strong></strong> to make things bold
<em></em> to emphasize
<ul><li> or <ol><li> to make lists
<h3> or <h4> to make headings
<pre></pre> for code blocks
<code></code> for a few words of code
<a></a> for links
<img> to paste in an image (it'll need to be hosted somewhere else though)
<blockquote></blockquote> to quote somebody

:grin: :shocked: :cry: Complete List of Smiley Codes

by
by
by
by
by
by