WordPress.org

Ready to get started?Download WordPress

Forums

wp-print problem (42 posts)

  1. tojulius
    Member
    Posted 8 years ago #

    I installed gamerz wp-print i got it working with posts but it does not work with pages of my website.

    is it possible to make it work for all the pages of the website or does it apply only to posts

    thanx

    julius

  2. Kafkaesqui

    Posted 8 years ago #

    Works fine here on Pages. How are you linking to them?

  3. tojulius
    Member
    Posted 8 years ago #

    I am not linkin it actually and i think it might mìbe the problem.

    Actually i contacted gamerz and he said it is not developed for pages but only for posts.

    So if you can tell me how to do it would be beautiful.

    Thanks

    Julius

  4. Kafkaesqui

    Posted 8 years ago #

    "I am not linkin it actually"

    Then how do you get posts to show in it? Something like:

    wp-print.php?page_id=1

    Works with Pages.

  5. tojulius
    Member
    Posted 8 years ago #

    actually i followed the procedure on the readme file, as i am not using permalink i put

    // Open wp-content/themes/<YOUR THEME NAME>/index.php
    // Note: If you ARE NOT using nice permalink url
    Find:
    ------------------------------------------------------------------
    <?php while (have_posts()) : the_post(); ?>
    ------------------------------------------------------------------
    Add Below It:
    ------------------------------------------------------------------
    ">Print This Article

    That is what i did. The print this article link is showed on either pages or posts but only when i click it on posts i got redirected on the post to print, while when i try to prin a page I got an error message saying " no post matches your criteria".

    Gamerz told me it does not work with pages, now if you have another way to make it work, please explain me!

    thanx

  6. Kafkaesqui

    Posted 8 years ago #

    "Gamerz told me it does not work with pages"

    Give this to Gamerz as an answer: replace the "Print" line with

    <?php if(is_page()) : ?>
    <a href="wp-print.php?page_id=<?=the_ID()?>">Print</a>
    <?php else : ?>
    <a href="wp-print.php?p=<?=the_ID()?>">Print</a>
    <?php endif; ?>

    Or if a theme has single.php and page.php templates, use the different print link versions for each (i.e. ?page_id= for page.php, ?p= for single.php).

    Love supporting other peoples' work...

  7. tojulius
    Member
    Posted 8 years ago #

    cheers mate, nice and easy....i'll tell gamerz!

    thanx

  8. Lester Chan
    Member
    Posted 8 years ago #

    thanks for the fix bud!

  9. gwoodard
    Member
    Posted 8 years ago #

    What is the URL fro gamerz WP Print?

  10. James
    Happiness Engineer
    Posted 8 years ago #

  11. Beel
    Member
    Posted 8 years ago #

    I was getting tired of people arriving at my site via Google and getting the wp-print version rather than the post itself, so I added the following to wp-print.php:
    <meta name="robots" content="index,follow" />

    If anyone just happens to be using this and 1.6-do-not-use, have you figured out how to get it to work with the "nice" permalinks? ;-)

  12. Lester Chan
    Member
    Posted 8 years ago #

    you can just put no if you do not want bots

  13. Beel
    Member
    Posted 8 years ago #

    Oops, thanks GamerZ, I meant "noindex,follow".

  14. Lester Chan
    Member
    Posted 8 years ago #

    LOl, no prob

  15. spencerp
    Member
    Posted 8 years ago #

    To Gamerz,

    I had added this plugin to my blog, followed the directions but for some reason kept getting a 500 internal server error page. =( I'm using (nice) permalinks on the blog. Added this like you said in the readme.txt:

    / Go to Manage > Files > Common -> .htaccess (for rewrite rules)
    // Note: If you ARE using nice permalink url
    Find:
    ------------------------------------------------------------------
    # END WordPress
    ------------------------------------------------------------------
    Add Below It:
    ------------------------------------------------------------------
    RewriteRule ^archives/([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/([^/]+)/print/?$ <BLOG URL>/wp-print.php?year=$1&monthnum=$2&day=$3&name=$4 [QSA,L]
    ------------------------------------------------------------------

    Shouldn't that be up above the </IfModule> # END WordPress line? I was just curious... I did that via the control panel, then when that failed..I tried it manually and uploaded the same .htaccess file with the changes and still the 500 internal errors. =( I had done all the other stuff as posted in the ReadMe.txt file as well. I then just took out the plugin all together.

    Also, even while at your site looking through the comments for the plugin, someone that had the 500 error as well said something about a fix, but didn't really explain how to do it. Any suggestions maybe?....thanks. =)

    spencerp

  16. Lester Chan
    Member
    Posted 8 years ago #

    The </IfModule> will check to make sure that you have mod_rewrite activated, you have it activated/installed, it should not pose a problem.

    Did you replace <BLOG URL> with your url to the wordpress folder. If your wordpress folder is in the root, it will be like this.
    ^archives/([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/([^/]+)/print/?$ /wp-print.php?year=$1&monthnum=$2&day=$3&name=$4 [QSA,L]

  17. spencerp
    Member
    Posted 8 years ago #

    " The </IfModule> will check to make sure that you have mod_rewrite activated, you have it activated/installed, it should not pose a problem. "

    Oh ok, I was just curious cause it looked like all the others were above that tag, hehe. =)

    " Did you replace <BLOG URL> with your url to the wordpress folder. If your wordpress folder is in the root, it will be like this.
    ^archives/([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/([^/]+)/print/?$ /wp-print.php?year=$1&monthnum=$2&day=$3&name=$4 [QSA,L] "

    [ slaps self ] Haha, damn.... no I didn't... Sometimes while adding plugins I tend to overlook the little things like that, but I guess I was thinking that <BLOG URL> tag was a working call function already or something. Hahaha...I dunno..this tends to happen when I'm missing my usually daily dose of alchol. =)

    My blog is right in the root folder called: Blog so I'll just do as you said above then, I'll post an update about it if it works or not. Thanks for your replies. =)

    spencerp

    P.S. Also, I already added this in the wp-print.php file as well, don't need any problems with people coming in from google searches and what not lol.
    <meta name="robots" content="noindex,follow" />

  18. spencerp
    Member
    Posted 8 years ago #

    Well, like I said, I was going to post an update either way and the 500 errors went away. But for some reason yet, I'm getting the 404 error page after clicking the "Print this Article" link. Here below is what I tried.

    1) RewriteRule ^archives/([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/([^/]+)/print/?$ /wp-print.php?year=$1&monthnum=$2&day=$3&name=$4 [QSA,L]
    2) RewriteRule ^archives/([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/([^/]+)/print/?$ /blog/wp-print.php?year=$1&monthnum=$2&day=$3&name=$4 [QSA,L]
    3) a href="<?php the_permalink(); ?>print/">Print This Article
    4) a href="<?php the_permalink(); ?>/print/">Print This Article

    The only thing I didn't do exactly was:
    // Open wp-content/themes/<YOUR THEME NAME>/index.php

    Find:
    ------------------------------------------------------------------
    <?php while (have_posts()) : the_post(); ?>
    ------------------------------------------------------------------
    Add Below It:
    ------------------------------------------------------------------
    a href="<?php the_permalink(); ?>print/">Print This Article

    I had added the "print link" into the coding for right underneath the post instead of having it show above the post. Like here below:

    <p class="postmetadata"><img valign="middle" src="<?php bloginfo('stylesheet_directory'); ?>/images/file.gif"/> Posted in <?php the_category(', ') ?> | <?php edit_post_link('Edit','','|'); ?> <img valign="middle" src="<?php bloginfo('stylesheet_directory'); ?>/images/file.gif"/> a href="<?php the_permalink(); ?>print/">Print This Article
    <img valign="middle" src="<?php bloginfo('stylesheet_directory'); ?>/images/comments.gif"/> <?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?>

    If you want, just click my Blog link on the user name in sidebar here and you'll see it below the post. =) I'm not really sure of the position of the print link would screw it up, but who knows... =)

    spencerp

    P.S. I removed the < a > and < / a > tags so you can see it better. Also, the Blog folder was in the root folder, so I made the /blog/wp-print.php changes to the htaccess file. Yet, I still can't figure out why it wasn't working for the print link, it takes me to the 404 page. =( Dang, I wish I had some beer or vodka, this usually helps me in these situations lol!!

  19. Lester Chan
    Member
    Posted 8 years ago #

    Hi, I check your site, I notice the link is abit wierd
    1) http://vindictivebastard.net/blog/twisteds-memory-lane-up-in-a-blaze.htmprint/

    How come there is a .htm at the back of the link?

    2) I tried: http://vindictivebastard.net/blog/wp-print.php?name=twisteds-memory-lane-up-in-a-blaze

    And it works, your pemlink is slightly different for the default.

    3) Try this
    RewriteRule ^blog/([^/]+)/print/?$ /blog/wp-print.php?name=$1 [QSA,L]

    4) try removing the .htm in the url bar if it doesnt work

  20. spencerp
    Member
    Posted 8 years ago #

    Oh, I'm using this for posts with the nice permalinks. /%postname%.htm I did that so it would be seen by google as an htm or html page rather then the pg=1 or whatever for posts.

    I guess I could try that once....just liked the .htm ending though. =)

    Here's the part of the htaccess file with the .htm codes included:

    RewriteRule ^([^/]+).htm/trackback/?$ /blog/index.php?name=$1&tb=1 [QSA,L]
    RewriteRule ^([^/]+).htm/feed/(feed|rdf|rss|rss2|atom)/?$ /blog/index.php?name=$1&feed=$2 [QSA,L]
    RewriteRule ^([^/]+).htm/(feed|rdf|rss|rss2|atom)/?$ /blog/index.php?name=$1&feed=$2 [QSA,L]
    RewriteRule ^([^/]+).htm/page/?([0-9]{1,})/?$ /blog/index.php?name=$1&paged=$2 [QSA,L]
    RewriteRule ^([^/]+).htm(/[0-9]+)?/?$ /blog/index.php?name=$1&page=$2 [QSA,L]

    Maybe that could also help for future reference or something, if someone else uses this same setup for posts. Would be kinda cool to get this working with the .htm on the end lol. =)

    spencerp

    P.S. I tried number three there and it didn't work, also tried removing the .htm for the posts /%postname%.htm <- there and got a 404 within the blog. Also, tried some other stuff with the htaccess file and nothing...so...I'm not really sure now lol. This is kinda of interesting and would be awesome if we could get this working with my setup for .htm endings though....hehe. Weeee!! =)

  21. Lester Chan
    Member
    Posted 8 years ago #

    I will try my very best to get it working. LOL. It is challenging, I love challenging jobs =)

    Try this:
    RewriteRule ^([^/]+).htm/print/?$ /blog/wp-print.php?name=$1 [QSA,L]

    It should work. Put this after #END WordPress

  22. Lester Chan
    Member
    Posted 8 years ago #

    For the link try this
    <a href="<?php the_permalink(); ?>print/">Print This Article</a>
    or
    <a href="<?php the_permalink(); ?>/print/">Print This Article</a>

    I cant remember which one. LOL memory failing me.

  23. katie1
    Member
    Posted 8 years ago #

    Hey GamerZ

    Could I ask you to please valid the following. For some reason the wp-print doesn't work on my posts anymore.

    I swear I haven't touched ANYTHING! :) but I keep getting typical browser 404 error when I click the link

    RewriteRule ^([^/]+)/([0-9]+)/print/?$ /wordpress/wp-print.php?name=$1&p=$2 [QSA,L]1</code>

    html
    <code>
    <p id="filedunder">Filed under: <?php the_category(','); ?> | print/">Print This Article`

    Thanks so much for your time and help. Really appreciate it.

    Kate

  24. Lester Chan
    Member
    Posted 8 years ago #

    hi there, dont mind you put your codes between backicks and not

    Is there a site I can see?

  25. spencerp
    Member
    Posted 8 years ago #

    YES!! It works! It really really works!! Hahaha!! Thanks so much GamerZ!! =) Maybe you could use this in the next release of the plugin or even update the readme.txt about that... hehe. Just figured after all that playing around and experimenting, would be worth the adding, to the readme file lol.. =)

    For getting the WORDPRESS PRINT PLUGIN working on the following Permalink Structure, please read below:

    For those using a Permalink Structure of just this: /%postname%.htm

    // Open root WordPress folder

    Put
    ------------------------------------------------------------------
    wp-print.php

    // Go to Manage > Files > Common -> .htaccess (for rewrite rules)
    // Note: If you ARE using nice permalink url
    Find:
    ------------------------------------------------------------------
    # END WordPress
    ------------------------------------------------------------------
    Add Below It:
    ------------------------------------------------------------------
    RewriteRule ^([^/]+).htm/print/?$ /your blogs name/wp-print.php?name=$1 [QSA,L]
    ------------------------------------------------------------------

    // Open wp-content/themes/<YOUR THEME'S NAME>/index.php

    Find:
    ------------------------------------------------------------------
    <?php while (have_posts()) : the_post(); ?>
    ------------------------------------------------------------------
    Add Below It:
    ------------------------------------------------------------------
    < a href="<?php the_permalink(); ?>/print/">Print This Article < / a
    ------------------------------------------------------------------

    P.S. Remember, no spaces between the ( < and A ) and remember to add the ( > ) tag for the end. Please don't forget to make sure the [a href] tags are right on the front and end.

    Thank God it's working now, thank you so much again GamerZ! =) Here's a link to a working print topic page.
    http://vindictivebastard.net/blog/inregards-to-the-print-link-below-posts.htm/print/

    spencerp

  26. lonetrotter
    Member
    Posted 8 years ago #

    To Kafkaesqui:

    "Or if a theme has single.php and page.php templates, use the different print link versions for each (i.e. ?page_id= for page.php, ?p= for single.php)."

    I am also trying to get wp-print along writing not only posts, but also pages, but think im to new to understand the PHP-thing here.

    Im using permalinks - what should I put in single.php and page.php? If I only put

    "<a>print/">Print This Article</a>"

    after the usual

    "...ile (have_posts()) : the_post(); ?>"

    its not working (Not Found).

    I am really trying to catch up here. ;o)

  27. Lester Chan
    Member
    Posted 8 years ago #

    spencerp: glad it is working. No Problem!

    lonetrotter: Is there a site I can see? Read the last portion of the readme regarding pages. You can put it in single.php

  28. lonetrotter
    Member
    Posted 8 years ago #

    Sure GamerZ! Its in swedish though... But < a href="http://www.cogito.nu/">here it is.

    I've read your Read me - and as I understood it the last part was only for peole not using permalinks (I do).

    "// Note: If you ARE NOT using nice permalink url
    // Open wp-content/themes/<YOUR THEME NAME>/index.php
    Find: [...]"

    I dont know if this is important at all, but - I've used your wp-print before, and added the old rewriterules in the .htaccess as they where before. Now when I tried to add the latest RewriteRule after # END, something happened and the hole sigth disappeard - so I skipped that latest rewriterule. If that could something to to with anyting you can get my htaccess and unzipit < a href="http://www.cogito.nu/copy.htaccesscopy.zip">here

  29. lonetrotter
    Member
    Posted 8 years ago #

    Sure GamerZ! Its in swedish though... But here it is.

    I've read your Read me - and as I understood it the last part was only for peole not using permalinks (I do).

    "// Note: If you ARE NOT using nice permalink url
    // Open wp-content/themes/<YOUR THEME NAME>/index.php
    Find: [...]"

    I dont know if this is important at all, but - I've used your wp-print before, and added the old rewriterules in the .htaccess as they where before. Now when I tried to add the latest RewriteRule after # END, something happened and the hole sigth disappeard - so I skipped that latest rewriterule. If that could something to to with anyting you can get my htaccess and unzipit here

  30. Lester Chan
    Member
    Posted 8 years ago #

    Hi there,

    The printer friendly page looks ok to me

    http://www.cogito.nu/2005/11/16/clive-hamilton-forelaser-den-24-november/print/

    Just dl the latest wp-print.php and overwrite it with your old one that is all, you do not need to touch/edit any files

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.