Moving the subtitle info above the main logo & putting a box around read more (w/ annotated shot

Hey there:

Re: Moving the subtitle info above the main logo & putting a box around read more (w/ annotated shots).

In the Subscribe By Email "mail-template.php" we are looking to do these two things.

The text explains is in the annotated screenshot so I won't repeat here to save you reading two times.

Thanks a bunch . . .

:slight_smile:

  • Michael Bissett

    Hey @Greg, hope you're doing well this evening! :slight_smile:

    For your first question, inside of your mail-template.php, remove this from line 245:

    <?php echo wpautop( $this->settings['header_text'] ); ?>

    Move this down to line 219:

    <tr>

    And insert this on line 218:

    <tr><td><?php echo wpautop( $this->settings['header_text'] ); ?></td></tr>

    Lines 218-220 should all look like this:

    <tr><td><?php echo wpautop( $this->settings['header_text'] ); ?></td></tr>
    												<tr>
    													<td><a href="<?php echo get_home_url(); ?>"><img style="max-width:<?php echo $this->settings['logo_width']; ?>px;" src="<?php echo $this->settings['logo']; ?>"></a></td>

    Regarding the moving of that "Continue Reading" button down...

    Change lines 127-129 from this:

    public function set_excerpt_more( $more ) {
    		return ' <a href="'. get_permalink( get_the_ID() ) . '">' . __( 'Read more...', INCSUB_SBE_LANG_DOMAIN ) . '</a>';
    	}

    To this:

    public function set_excerpt_more( $more ) {
    		return '</br><p style="text-align: center;"><a href="'. get_permalink( get_the_ID() ) . '" style="border: 1px solid black;padding: 9px;">' . __( 'Read more...', INCSUB_SBE_LANG_DOMAIN ) . '</a></p>';
    	}

    (I realize you've change the "Read more..." text here, you can ignore that part of my code quote here :slight_smile: )

    Hope this helps! :slight_smile:

    Kind Regards,
    Michael

  • Greg

    @Michael Bissett

    Before the most recent update the "Continue Reading..." (aka "Read More...") box you mentioned above from Feb 26th worked perfectly. After the most recent update, however, it still shows in the "dummy" preview area BUT when posts are made the "Continue Reading..." box does not show anymore.

    You mentioned:

    Regarding the moving of that "Continue Reading" button down...

    Change lines 127-129 from this:

    public function set_excerpt_more( $more ) {
    		return ' <a href="'. get_permalink( get_the_ID() ) . '">' . __( 'Read more...', INCSUB_SBE_LANG_DOMAIN ) . '</a>';
    	}

    To this:

    public function set_excerpt_more( $more ) {
    		return '</br><p style="text-align: center;"><a href="'. get_permalink( get_the_ID() ) . '" style="border: 1px solid black;padding: 9px;">' . __( 'Read more...', INCSUB_SBE_LANG_DOMAIN ) . '</a></p>';
    	}

    (I realize you've change the "Read more..." text here, you can ignore that part of my code quote here :slight_smile: )

    -----------

    Can you take and look and let me know what needs to be adjusted to make this show up in the actual post sends since the most recent update to SBE?

    :slight_smile:

    Looking forward to hearing back...thanks Micheal!

  • Michael Bissett

    Hey @Greg,

    When I apply that change I mentioned to the mail-template.php on my test site (using the latest version, 3.0.2), I'm seeing that the Read More/Continue Reading button shows up in the email when a post is published (see screenshot below).

    Have you tried only changing that section of the code, and seeing if that box shows up again? I've attached a copy of my edited file (which works for me presently).

    Please advise,
    Michael

  • Greg

    @Michael Bissett

    Re: the SBE "Continue Reading..." box, link, and color above.

    I have tried this on the latest mail-template.php to get the "Continue Reading..." box to show up and be clickable. It is still not working. It shows up in the preview and tests but not in the actual send of the post.

    ***Would also like to make the text gray instead of royal blue.

    Could you look at the new code for the latest SBE and maybe shoot over fresh code that will not conflict with the above version. I have tried multiple times for over a month.

    Could we just do it fresh?

    OR, perhaps there is some bug the developers need to look at (I thought I saw some other threads with folks have issue with the "Read More" link too anyway.

    Please let me know...

    SEE THE NEXT REPLY BELOW FOR SCREENSHOTS OF THE PREVIEW VS. THE ACTUAL.

    :slight_smile:

    Greg

  • Michael Bissett

    Hey @Greg,

    I'm still not able to reproduce this over on my test site, even with the latest version of Subscribe by Email we have out now, changing lines 127-129 of mail-template.php to the code I suggested still works for me.

    I think a deeper look at your site here is needed now, could you please send in the following via our secure contact form:

    - Mark to my attention, the subject line should contain only: ATTN: Michael Bissett
    - Do not include anything else in the subject line, doing so may delay our response due to how email filtering works.
    - Link back to this thread
    - Include WordPress admin access details (login address, username & password)
    - Include FTP log-in details (hostname, username & password)
    - Include any relevant URLs for your site

    On the contact form (linked to below), please select "I have a different question", this ensures it comes through and gets assigned to me.

    https://premium.wpmudev.org/contact/

    Thanks a bunch! :slight_smile:

    Kind Regards,
    Michael

  • Greg

    @Michael Bissett

    Hey, thanks, I just sent all the info via email.

    Also, while we are at this, can you be sure they are set correctly for sending out auto blog post digests? They are set for Monday's EST at 0400+/-.

    The host and ftp I sent you is http://bluehost.com (you can use the exact same FTP login info to get in if needed too). See the email.

    Here is teh cron job we have setup and showing it is firing. Right now, we have it every 5 min. Also, I have wp-cron disabled in the config. The below just shows the test sends are working from Bluehost:

    Forwarded conversation
    Subject: Cron <segretof@box1049> wget -O /dev/null http://blog.segretofinishes.com/wp-cron.php
    ------------------------

    From: Cron Daemon <root@box1049.bluehost.com>
    Date: Fri, May 8, 2015 at 10:30 PM
    To: (removed by moderator)

    --2015-05-08 20:30:02-- http://blog.segretofinishes.com/wp-cron.php
    Resolving blog.segretofinishes.com... 173.254.111.104
    Connecting to blog.segretofinishes.com|173.254.111.104|:80... connected.
    HTTP request sent, awaiting response... 200 OK
    Length: 0 [text/html]
    Saving to: “/dev/null”

    0K 0.00 =0s

    2015-05-08 20:30:03 (0.00 B/s) - “/dev/null” saved [0/0]

    Thanks Michael.

    :slight_smile:

    Greg

  • Greg

    @Michael Bissett

    Oh, last thing . . . promise (if we can also make the "Continue Reading..." text the same gray that the post title is in below the image as well as the big, currently royal blue, name of the blog that is centered at the bottom that would be fantastic . . . same gray color for that . . .

    That is it!

    Please let me know what you find out and how you fix the "Continue Reading..." box (I have been baffled for over a month on that one...lol.

    :slight_smile:

    Greg

  • Michael Bissett

    Hey @Greg,

    Also, while we are at this, can you be sure they are set correctly for sending out auto blog post digests? They are set for Monday's EST at 0400+/-.

    This'd be something that we'd want to tackle in another thread, we'll want to stay on topic with this thread. :slight_smile:

    Now, back to the issue with the template... after inserting the test mail-template.php I mentioned earlier in the thread here (on your test site), I did find that the "Continue Reading" box showed up for me when I tried creating a new post, so it appears that the template you had (which I've renamed mail-template-old.php) has a quirk in it somewhere...

    You'll want to open both files up in an editor like Notepad++:

    https://notepad-plus-plus.org/

    And search for the changes you made in your file. To be honest, the mail-template-old.php was a mess when I tried to open it, so you may wish to try re-implementing the changes you made in that file in the new mail-template.php file I placed on your site.

    Oh, last thing . . . promise (if we can also make the "Continue Reading..." text the same gray that the post title is in below the image as well as the big, currently royal blue, name of the blog that is centered at the bottom that would be fantastic . . . same gray color for that . . .

    Let's try getting the main-template.php file sorted out first, before we go messing with that, once we get that straightened out, then we can proceed with changing the file. :slight_smile:

    Kind Regards,
    Michael

  • Greg

    @Michael Bissett

    I see what the problem is. Wordpress has a "Excerpt" box that can be used. We have been using it recently to only put exact text we want to go with the emails and other excerpts on the site for blog posts. When we use that feature (see attached) no matter what or how long or short it is the "Read More" OR "Continue Reading" link will NOT WORK. When this is blank it DOES work every time. Could you have development look into allowing it to work in the future release OR let me know how to force it to work if there is a way?

    Also, see the latest post that should do for the moment since the next post goes out in the morning.

    :slight_smile:

    Greg

  • Michael Bissett

    Hey @Greg,

    I see what the problem is. Wordpress has a "Excerpt" box that can be used. We have been using it recently to only put exact text we want to go with the emails and other excerpts on the site for blog posts. When we use that feature (see attached) no matter what or how long or short it is the "Read More" OR "Continue Reading" link will NOT WORK. When this is blank it DOES work every time.

    Ah okay, I see what you mean now. :slight_smile:

    By default, WordPress doesn't seem to limit manual excerpts (like what you're wanting to use), that being the reason why you're not seeing a "Read More" link show up, but we can remedy that by inserting this code into your site as a mu-plugin:

    function wp_trim_all_excerpt($text) {
    // Creates an excerpt if needed; and shortens the manual excerpt as well
    global $post;
      $raw_excerpt = $text;
      if ( '' == $text ) {
        $text = get_the_content('');
        $text = strip_shortcodes( $text );
        $text = apply_filters('the_content', $text);
        $text = str_replace(']]>', ']]>', $text);
      }
    
    $text = strip_tags($text);
    $excerpt_length = apply_filters('excerpt_length', 55);
    $excerpt_more = apply_filters('excerpt_more', ' ' . '[...]');
    $text = wp_trim_words( $text, $excerpt_length, $excerpt_more ); //since wp3.3
    /*$words = explode(' ', $text, $excerpt_length + 1);
      if (count($words)> $excerpt_length) {
        array_pop($words);
        $text = implode(' ', $words);
        $text = $text . $excerpt_more;
      } else {
        $text = implode(' ', $words);
      }
    return $text;*/
    return apply_filters('wp_trim_excerpt', $text, $raw_excerpt); //since wp3.3
    }
    
    remove_filter('get_the_excerpt', 'wp_trim_excerpt');
    add_filter('get_the_excerpt', 'wp_trim_all_excerpt');

    I'm seeing that it does the trick on my test site when I use it, could you give it a shot please? :slight_smile:

    Kind Regards,
    Michael

    P.S. Code credit:

    http://www.transformationpowertools.com/wordpress/automatically-shorten-manual-excerpt

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.