Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Montezuma Theme (http://forum.bytesforall.com/forumdisplay.php?f=53)
-   -   author not showing after uprade to 1.2.2 (http://forum.bytesforall.com/showthread.php?t=22026)

filo Apr 8, 2014 02:37 AM

author not showing after uprade to 1.2.2
 
Hi, I have a few problems with the recent update.
After installing the update, the “author” isn’t showing anymore on the front end. I had previously customized the theme so that the footer (byline, date, category) would appear right below the page title, and it worked ok. Since I installed the update, “author” isn’t displayed anymore, while date and categories are fine.
Also, I set up infinite scroll on my home page, and as I scroll past the first page the main image of each post disappear.
Any idea on how should I proceed to fix these issues? Thank you!

juggledad Apr 8, 2014 03:41 AM

the_author() works for me. Where exactly are you using it? What's the url showing the issue?
Please attach the montezuma 'Export' settings

filo Apr 10, 2014 12:10 PM

1 Attachment(s)
Hi,

Thank you for your quick reply. I'm using montezuma on my website at www.atlantidezine.it.
On every article (e.g. http://www.atlantidezine.it/frida-ka...quirinale.html) the footer is still showing up right below the main title, as per my previous customization, but it missing the author, which was instead displayed correctly before the update:

Pubblicato il 7 apr 2014 da [MISSING AUTHOR] in Arti visive · mostre

Please find attached the txt with the export settings (hopefully I used the right encoding!).

Thank you for your help!

juggledad Apr 10, 2014 07:21 PM

it's a good thing you atached the export. It is not 'the_author()' that is not working, it is 'the_author_posts_link()' that is not working.

I'll take a look at it tomorrow if I have some time.

juggledad Apr 11, 2014 08:40 AM

Just to let you know
1) I've moved tis to a new thread and
2) I went back and tested each release back to Montezuma 1.1.2 and 'the_author_posts_link()' has never worked.

filo Apr 12, 2014 05:03 AM

sorry if I keep posting here, I don't seem to find the new thread!

Honestly I don't really know php so I can't say... But I can tell you that in the front end the name of the author (and the link to all his/her articles) was working fine before. It worked in its original configuration (footer at the end of the post) and it worked fine also after my customization (moving the footer below the post title).

CrouchingBruin Apr 13, 2014 06:02 PM

I imported your settings, and my posts show the author name in the post header; clicking my name takes me to a category page with a list of all my posts:
http://i192.photobucket.com/albums/z...Press/filo.jpg

CrouchingBruin Apr 13, 2014 06:15 PM

I'm not sure if this is the cause of your problem or not, but go to single.php. In there is this line:
Code:

Pubblicato il <?php the_time( 'j M Y' ); ?>  da <?php the_author_posts_link() ?>  in<?php the_category( ' · ' ); ?>
It is missing a semi-colon after the call to the_author_posts_link(). Add the semi-colon so it looks like this:
Code:

Pubblicato il <?php the_time( 'j M Y' ); ?>  da <?php the_author_posts_link(); ?>  in<?php the_category( ' · ' ); ?>

filo Apr 14, 2014 10:46 AM

mhm... nope, still not working.

Since my settings seem to be working fine on your end, could it be just a matter of a conflict with one of the plugins installed in my WP?

When I customized the previous version of the theme, I remember I had to change something to make the "co-author" plugin works, and while I was working on that I remember I found a syntax error. Unfortunately I don't recall if I found that error in some of the theme's phps, or if it was in the plugin files. I just know that somehow it was working fine!

Thank y'all for all your help!

CrouchingBruin Apr 14, 2014 11:11 AM

What is interesting is that the same function works correctly on your home/index page; the author's name shows up in the post footers, and when you click on it, you get the author's page. The problem seems to be isolated to the single post page.

So, yes, I would try deactivating all of your plugins and see if it works. If it does, then re-activate your plugins one-by-one to see which one is interfering.

juggledad Apr 14, 2014 12:19 PM

See post #4

CrouchingBruin Apr 14, 2014 01:45 PM

I did, and when I imported his export file, I saw that he's using the_author_posts_link() in both his postformat.php file and his single.php file. It seems to be working fine on the home page, which uses postformat.php in the index.php main template. You can see the author name below the post excerpt, and clicking on it takes you to the author's page. But the same function call on a single post page does not display the same author link, it's just blank.

CrouchingBruin Apr 14, 2014 02:40 PM

After reverting my sandbox site to where it was before the import, I also tried using the_author_posts_link() in both my postformat.php file and my single.php file. I do get a link to the author page as described in the documentation in both my index page and my single post pages, so it appears that the function does work.

filo Apr 15, 2014 04:54 AM

I tried to deactivate every plugin installed on my WP (first one by one, then all of them at once) but to no avail: author still didn't show up on articles. while shows up fine on the home page... *sigh*

(btw, I found another little bug after updating: I have infinite scroll installed on my homepage, and when I scroll past the first page the main header image of each post disappears. Also the little icons for tags/categories disappear. Deactivating infinite scroll doesn't solve the issue, cause also when in page-by-page layout images from the second page on won't show up. This is kinda annoying, but a minor issue of course, author is far more important!)

juggledad Apr 15, 2014 06:20 AM

the_author_posts_link() will work depending on where it is used and when it is used. If you use it BEFORE the content, it doesn't work, if you use it AFTER the content it does.

I suspect that it is because the_author_posts_link() must be used in the loop (wordpress requirement) and technically when you go to a single post and display it before the content you are not in the loop yet.

to get it to work on your single post pages, move
HTML Code:

              <div class="post-footer">
                                Pubblicato il <?php the_time( 'j M Y' ); ?>* da <?php the_author_posts_link() ?> * in<?php the_category( ' · ' ); ?>
                               
                        </div>

to after
HTML Code:

                    <div class="post-bodycopy cf">
                                <?php the_content(); ?>
              <?php the_tags( __( '<p class="post-tags">Tags: *', 'montezuma' ), ' · ', '</p>' ); ?>
                                <?php wp_link_pages( array(
                                        'before' =>
__( '<p class="post-pagination">Pages:', 'montezuma' ),
                                        'after' => '</p>'
                                ) ); ?>
           
                        </div>


filo Apr 15, 2014 10:00 AM

Fixed it. In "parse_php.php" there's a spelling mistake:

Code:

$need_loop = array( 'the_author',
                                                'the_author_meta',
                                                'the_author_posts_links',
                                                'the_content',
                                                'the_date',
                                                'the_excerpt'
                                                );

Remove the "s", and the footer displays correctly whether it is placed before or after the content (or both, for that matters).

Thank you both for looking into it!

PS: any ideas about the other problem? (header imgs and tag icons on post excerpt displaying only on page 1)

CrouchingBruin Apr 15, 2014 04:36 PM

Ah, no wonder this sounds so familiar. There was another thread about the_author_posts_link, and it was supposed to have been fixed in release 1.2.2. It looks like the fix didn't make the release.

CrouchingBruin Apr 15, 2014 05:17 PM

As far as why the post thumbnails aren't showing up on the infinitely scrolled pages, I'm guessing it's because the grayscale images which overlay the color images are created using a function that fires off on document ready (i.e., after the page finishes loading). Since the infinite scroll uses AJAX to retrieve additional posts, the function doesn't get called again, so the grayscale images aren't created, and the opacity property of the color image remains at 0 (transparent). If you examine those posts which are coming in through the infinite scrolling plugin using Firebug or Chrome Developer Tools, you'll see that the grayscale image is missing.

What you might consider doing is bypassing the grayscale-to-color effect and just having your thumbnails be a static color image. You can try adding this CSS to the end of your various.css file:
Code:

.post-thumb .img_grayscale {
  display: none;
}
.post-thumb img {
  opacity: 1 !important;
}

What this will do is hide the grayscale images on the first visible page, and turn opacity on for all the color thumbnails. Now all of your thumbnails should show, even the ones coming in through infinite scroll, but in color, not starting off grayscale.

If you want to try & keep the grayscale-to-color effect, you'll have to dig through the code and find which function creates the grayscale images, then have it called when the infinite scroll script finishes loading the next page of images, or clone that code into the infinite scroll's code.

I'm also guessing that the problem with the icons is similar, that the icons are created by appending an italics tag to certain elements using a jQuery ready function that doesn't get called again because the infinite scroll routine uses AJAX to update the page. I'm not sure if there's an easy solution to that one, I'll have to think about it. You don't happen to know if the infinite scroll plugin has a way to call a function after it finishes loading a page, do you?

CrouchingBruin Apr 15, 2014 05:58 PM

OK, I've also come up with a solution to the missing category and tag icons. Sorry to keep you waiting ;)

As I mentioned earlier, I'm assuming that there's a jQuery function that fires off on document ready that adds an italic tag to various elements, like elements having the post-categories or post-tags class. So what you can do is manually add them in to your postformat.php file.

In postformat.php, change this:
Code:

      <p class="post-categories"><?php the_category( ' · ' ); ?></p>
      <?php the_tags( '<p class="post-tags">', '', '</p>' ); ?>

To this:
Code:

      <p class="post-categories"><i></i><?php the_category( ' · ' ); ?></p>
      <?php the_tags( '<p class="post-tags"><i></i>', '', '</p>' ); ?>

Your first page will now show two icons for each post, because the theme will have added another set of italic icons. The posts that come in through infinite scrolling will just have one, the one that we hard coded above. All we have to do, then, is tweak the CSS so that only the first set of italic tags are selected.

Go into your posts.css virtual CSS file, and look for this rule:
Code:

/* This <i></i> element is inserted by Javascript, as container for icons */
.post-tags i,
.post-categories i {
        display:                    inline-block;
        width:                      12px;
        height:                    12px;
        margin-right:            5px;
        background-image:        url(%tpldir%/images/icons.png);
}

Change the selectors so they look like this:
Code:

/* This <i></i> element is inserted by Javascript, as container for icons */
.post-tags i:first-child,
.post-categories i:first-child {
        display:                    inline-block;
        width:                      12px;
        height:                    12px;
        margin-right:            5px;
        background-image:        url(%tpldir%/images/icons.png);
}

Now, if there are two sets of italic tags, only the first one will become associated with the icon.

juggledad Apr 15, 2014 07:07 PM

Damn plurals…I've written a patch for this http://forum.bytesforall.com/showthread.php?t=22089

filo Apr 16, 2014 02:51 AM

Fix for categories/tags icons works like a charm, thanks!

Couldn't solve the problem with thumb imgs tho. From the 2nd page on, header images are showing up in color, without the greyscale animation, and that's perfectly fine. On the 1st page though, the greyscale animation is still there, but it seems it's being applied only to the wrapper of the header image, with the result that the main img (now in color) "jumps" on top of post-bodycopy and post-footer. I guess this happens because both the main img (the one in color) and the greyscale overlay are given the property "absolute" via javascript?
If I would like to remove the whole greyscale effect should I just remove the "function bfa_img_grayscale" from get_javascript.php and then change postformat.php accordingly?

juggledad Apr 16, 2014 03:51 AM

Try it and let us know what happens

CrouchingBruin Apr 16, 2014 07:09 AM

Did you reverse out the fix, because your site still behaves the same way as it did originally, i.e., I can't see the new behavior in order to examine it.

filo Apr 16, 2014 08:52 AM

yea, I reverted to the original state to try to remove the grayscale effect. I didn't want to bug y'all with too many questions ('cause I DO have many questions!) and I was trying to figure it out myself, but since I don't really know coding I have to do a lot of trial & error. I thought I'd do that starting from the original theme, with no changes. Honestly was hoping to find a post in here which addressed the same issue but didn't have much luck so far!

filo Apr 19, 2014 02:22 AM

ok, I was hoping I didn't need to bother you, but I guess this thing is way above my head :)
I could remove the grayscale image editing the css (.post-thumb img, .post-thumb img.img_grayscale, .post-thumb span). All images are now in color, although the shadow animation effect is still there. I assume the shadow is a javascript function, and I tried to remove that part from the code, but the only result was... crashing my whole website.

On a positive note, the layout of postformat is now intact and, most importantly, header images are now showing up when scrolling down after the first page. Icons for tags/categories are also showing up, too, if I apply the fix you suggested before.

I could say that, while it's not ideal, I could live with the shadow effect still being there, although if you know how to remove it altogether that would be awesome!


All times are GMT -6. The time now is 01:41 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.