• Resolved MarthaLindeman

    (@marthalindeman)


    I am getting the content on the prep page but all formatting is gone. That includes header formatting at all levels and there are no spaces between paragraphs. I also lose footnote numbers and get the literal math code before translated for viewing. Oddly, I do get correctly numbered and formatted references. I am using the open-source Yoko theme as I need its submenu below the header. Any advice or suggestions? I am willing to delve into the CSS if I have to do it.

    The page I need help with: [log in to see the link]

Viewing 12 replies - 1 through 12 (of 12 total)
  • Plugin Author Michael Nelson

    (@mnelson4)

    Hi @marthalindeman, sorry somehow Print My Blog and that theme aren’t playing nicely together. We’ll see what we can do to improve that!

    Could you please reactivate Print My Blog on your site so I can see what it’s producing? (It doesn’t need to show the print buttons, it just needs to be active. I’ll use my developer voodoo to make it show me what the problem is, but it does need to be active.)

    And a question: are you having this problem when printing several posts together, or just when printing individual posts?

    Thread Starter MarthaLindeman

    (@marthalindeman)

    Sorry I missed your message until now! I just activated the plugin and put the buttons on posts and pages. I had only tried the entire set of published pages, and just now I tried a single post. It has the same problem. I am leaving up the buttons in case you need to them—the blog is very new and it does not have any readers at this time. Thanks for your quick response. I really appreciate it!

    Plugin Author Michael Nelson

    (@mnelson4)

    Hi Martha, no worries, that’s still a pretty good response time.
    I see your theme is doing things a bit unusually which gave Print My Blog some grief. I have an improved version which plays more nicely with the theme… most of the styles now appear ok. Would you mind trying it out before I release to everyone?

    To try this new version do the following:
    1. Download the new version from here: https://github.com/mnelson4/printmyblog/archive/BUG/fix-screen-only.zip
    2. Go to your WordPress dashboard, click plugins, then “add new”, then “upload” and select the zip file you just downloaded
    3. Deactivate the previous version Print My Blog
    4. Activate the new version of Print My Blog
    5. When you use Print My Blog to print a post or page, the formatting should appear OK.

    Thread Starter MarthaLindeman

    (@marthalindeman)

    That was spectacular support—thanks!

    There is one remaining problem. The pages going to PDF are laid out as landscape rather than portrait, and nothing I do seems to change that. When I set my print function to landscape, I do not see any margin issues (other than they all are set to 0). When I change to portrait, the plugin print content does not change and there is content outside the margins. The plugin shows 22 pages processed but I get 76 pages to the printer. Am I missing something? Is there anyway to get it to print with portrait layout?

    Plugin Author Michael Nelson

    (@mnelson4)

    Hey @marthalindeman, thanks! Which browser are you using? And is it possible for you to send a screenshot highlighting the problem? From what I’ve noticed it’s going to portrait layout ok… so it’s either not happening for me or I’ve somehow not noticed the issue, sorry.

    Thread Starter MarthaLindeman

    (@marthalindeman)

    It did the same thing when using the Print button on a single page in my Android phone. If I change the Print orientation to Landscape each page of eight fits the contents perfectly, but for Portrait almost the entire bottom half of the page is blank for each page.
    I am using Chrome on the pc, and CloudPrint on Android. I double-checked by printing a portrait page on the pc just before doing the print page to make sure it was set up for Portrait because when I print from PrintMyBlog the ability to change between Portrait and Landscape dropdown is not on the screen.

    I took a screenshot from each device and put it in this post on Mental Power Tools. Debugging Post

    Plugin Author Michael Nelson

    (@mnelson4)

    Hi @marthalindeman, thanks for providing the screenshots.

    I investigated some more, and I confirmed Google Chrome was forcing me to print in landscape mode, BUT that happened both on using Print My Blog’s print-page AND on a regular blog post (where Print My Blog isn’t doing anything). After some more digging, I found the plugin LaTeXToHTML was adding some CSS that was doing that (it was instructing the browser to use landscape mode and use specific page dimensions).

    I don’t have an Android Phone so can’t reproduce that part of the issue.

    But I did notice you were actually using a child theme of Yoko, not Yoko itself, which meant some of the fix I made wasn’t taking effect (that’s normally a minor detail, but actually important in this case.)

    Could you please deactivate and delete the current version of Print My BLog you’re using, and then re-download from https://github.com/mnelson4/printmyblog/archive/BUG/fix-screen-only.zip, reactivate it, and try again?

    Plugin Author Michael Nelson

    (@mnelson4)

    Actually @marthalindeman, I was just testing the version and I don’t think Print My Blog should be forcing the page margins like I was doing on the version you tested (it was forcefully overriding the page margins set by Latext2Html plugin). I think its quite within a theme’s purview to adjust those margins, and, where reasonable, I want to let themes do their job without interference.

    So you should instead put the custom CSS in your theme to fix what Latex2Html is doing (or they should change their code, but it doesn’t look like it’s maintained very much.) Here’s how to add the custom CSS:

    1. Go to wp-admin on your website
    2. On the left, under “Appearance”, click “Customize”
    3. On the left, under Additional CSS” add the the following code:

    
    @media print{
        @page{
            size:initial !important;
            margin:initial !important;
        }
    }
    

    After you’ve done that, you can still follow the instructions from my previous comment to verify the upcoming version of Print My Blog will work for you.

    Thread Starter MarthaLindeman

    (@marthalindeman)

    Thanks for the great support! I just followed your instructions and printed the Published Posts and it worked perfectly. I did have to manually reset the margins and only then could I see the great header and footer info that is included. I also tested the print and pdf buttons on an individual post and they worked well (and they retained the margins I had manually set before). So this plugin is great for me to print the contents out for myself.

    I would like to keep the buttons on the post pages, but is it possible to get the following so I can?
    1. Smaller (less obtrusive) buttons. I am a UX designer and the current button design is so ‘in your face’ that it breaks the users’ train-of-thought from the post’s extract on the home page into reading the post. I might be able to use the current buttons if I get #2 below.
    2. Ability to put the buttons at the bottom of the page as people will probably read the post before deciding it was worth printing to keep. Also that would put them with my social-media buttons and users would only have to think once about ‘What do I want to do with this post?’ (I would be satisfied with just at the bottom, but other people probably would want to choose bottom, top or both.) Also, if I could control this by changing the priority of the plugin, that might work (although the footnotes plugin priority has already had to be changed and I do not know what it is now).

    Thanks for all your help!

    Plugin Author Michael Nelson

    (@mnelson4)

    Ok great to hear we’re making progress!

    1. You can adjust the text of the buttons without any coding. Go to WordPress dashboard, then under “Print My Blog”s menu item, click “Settings”. On that page click “Customize Buttons”. The “Label” is the button’s text (see screenshot). So you could change the text inside each button quite easily that way.
    For further customization, you’d have to dive into some CSS. For example, this custom CSS will make the buttons smaller, give them a white background:

    
    .entry .entry-content .pmb-print-this-page .button:not(.has-background){
    padding:5px;
    	margin:5px
    	background-color:white;
    	background:white;
    	color:black;
    	font-weight:normal;
    }
    

    2. You can move the buttons to the bottom of the page from the settings page, too. From the page mentioned earlier, instead change “Place Buttons” to “Below Content” (screenshot).

    I have just added a filter to change the button’s priority, if you need it. To get it, you’d need to re-download from https://github.com/mnelson4/printmyblog/archive/BUG/fix-screen-only.zip and add this code to your theme’s functions.php file:

    
    add_filter('PrintMyBlog\controllers\PmbFrontend->setHooks $priority',
    function($priority){
        return 20;
    }
    );
    

    Depending on what priority the other plugin is using, you’ll need to adjust that to return a different number. Most plugins use priority 10, so you’d use a lower number to have Print My Blog run earlier, or a big number to have it run later.

    Does that all make sense?

    Thread Starter MarthaLindeman

    (@marthalindeman)

    Thanks! Busy week, and I will get to this asap. I deeply appreciate your great support! Your communication is very clear.

    Plugin Author Michael Nelson

    (@mnelson4)

    I think we’re done. Feel free to reopen

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Losing all formatting’ is closed to new replies.