821 posts
  • Power Elite Author: Sold between 1 000 000 - 1 999 999 dollars
  • Power Elite Author
  • Won a Competition
  • Exclusive Author
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Europe
  • Bought between 50 and 99 items
+2 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
  • Author had a File in an Envato Bundle
  • Author had a Free File of the Month
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 5-6 years
  • Referred between 50 and 99 users
  • Sold between 10 000 and 50 000 dollars
+1 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 .

821 posts
  • Power Elite Author: Sold between 1 000 000 - 1 999 999 dollars
  • Power Elite Author
  • Won a Competition
  • Exclusive Author
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Europe
  • Bought between 50 and 99 items
+2 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
  • Author had a File in an Envato Bundle
  • Author had a Free File of the Month
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 5-6 years
  • Referred between 50 and 99 users
  • Sold between 10 000 and 50 000 dollars
+1 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(); ?>

821 posts
  • Power Elite Author: Sold between 1 000 000 - 1 999 999 dollars
  • Power Elite Author
  • Won a Competition
  • Exclusive Author
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Europe
  • Bought between 50 and 99 items
+2 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
  • Author had a File in an Envato Bundle
  • Author had a Free File of the Month
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 5-6 years
  • Referred between 50 and 99 users
  • Sold between 10 000 and 50 000 dollars
+1 more
danharper says

Make sure you have:


global $more;
$more = 0;

in your sidebar, above where you include a page.

821 posts
  • Power Elite Author: Sold between 1 000 000 - 1 999 999 dollars
  • Power Elite Author
  • Won a Competition
  • Exclusive Author
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Europe
  • Bought between 50 and 99 items
+2 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

821 posts
  • Power Elite Author: Sold between 1 000 000 - 1 999 999 dollars
  • Power Elite Author
  • Won a Competition
  • Exclusive Author
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Europe
  • Bought between 50 and 99 items
+2 more
wpbakery says

3 days of fighting without luck :(

by
by
by
by
by
by