WordPress.org

Ready to get started?Download WordPress

Forums

WP Photo Album Plus
[resolved] Displaying [WPAA+ Photo display] (21 posts)

  1. knottulf
    Member
    Posted 2 years ago #

    When inserting %%wpaa%% into the text-field of a page (nothing else), what shows up where the album should have been, is only this:

    <span style="color:blue; font-weight:bold; ">[WPPA+ Photo display]</span>

    Any idea?

  2. Jacob N. Breetvelt
    Member
    Plugin Author

    Posted 2 years ago #

    You most likely do not have a call to wp_head in your theme. This is required, see this fragment of header.php from the twentyten theme:

    /* Always have wp_head() just before the closing </head>
    	 * tag of your theme, or you will break many plugins, which
    	 * generally use this hook to add elements to <head> such
    	 * as styles, scripts, and meta tags.
    	 */
    	wp_head();
    ?>
    </head>
  3. v2c
    Member
    Posted 2 years ago #

    I am having the same issue. This plugin has worked great for months but now I see "[WPAA+ Photo display]" instead of it displaying the album.

    Thanks in advance for any and all help!

  4. knottulf
    Member
    Posted 2 years ago #

    the wp_head(); -line did the trick for me!
    Thank you opajaap!

  5. v2c
    Member
    Posted 2 years ago #

    wp_head(); did not work for me, any other ideas?

  6. Jacob N. Breetvelt
    Member
    Plugin Author

    Posted 2 years ago #

    If you supply a link to your site i will have a look into it.

  7. lupomontero
    Member
    Posted 2 years ago #

    I have the same problem but only when displaying a list of posts. When showing a single post view the photo album shows ok.

    In this page the shortcode doesn't get processed:
    http://www.wiserd.ac.uk/news/

    And as a single post it works:
    http://www.wiserd.ac.uk/news/wiserd-news/5th-july-celebratory-conference-for-professor-huw-beynon/

    Any pointers would be appreciated.

    Cheers,

    Lupo

  8. lupomontero
    Member
    Posted 2 years ago #

    By the way, I forgot to mention that this only started happening since I upgraded WordPress to version 3.2.

  9. Jacob N. Breetvelt
    Member
    Plugin Author

    Posted 2 years ago #

    I am working on this. The problem is that i cannot distinguish between the_content() and the_excerpt()
    WP strips all tags (so also the wppa+ photo display) in the_excerpt()
    So there i want the blue indicator. Currently i assume that posts based on the templates archive and search use the_excerpt() and show the indicator. If i render the wppa+ code to images in the_excerpt() you will see a few lines of javascript in the display.

    I asked on an developers forum how to distinguish between the_excerpt() and the_content(), but still no reply.

    If anybody knows this, please tell me.

    The code where i have this dillemma is in wppa_filter.php, around line 145 to 163:

    $do_it = false;
    			if ($wppa['rendering_enabled']) {
    				if ($wppa['in_widget']) $do_it = true;
    				else {
    					$do_it = true;
    					if (is_archive()) $do_it = false;	// Unfortunalely there is not such a simple thing as in_excerpt()
    					if (is_search()) $do_it = false;	// so we estimate that this is an excerpt (where my tags are stripped)
    				}
    			}
    			elseif (is_feed()) {
    				$do_it = true;
    			}
    
    			if ($do_it) { // ($wppa['rendering_enabled'] || is_feed()) && !is_archive() &&!is_search()) {	// Insert the html
    				$post_new .= wppa_albums();
    			}
    			else {											// Or an indicator
    				$post_new .= '<span style="color:blue; font-weight:bold; ">[WPPA+ Photo display]</span>';
    			}
  10. Jacob N. Breetvelt
    Member
    Plugin Author

    Posted 2 years ago #

    Further:

    So this is not because you updated wp to 3.2, i changed the filter around the same time.

    At this moment, a have a solution that almost works. I added a filter for the excerpt, and set a flag myself, so if the_excerpt() is called, i know it and can take appropriate action in the the_content() filter.

    However, the the_content() filters are run before the the_excerpt() filters, so the first excerpt of a list will still be treated as a content in stead of an excerpt.

    But, its something... if you like this temporary solution, update to wppa+ 3.1.3

    I found a discrepancy in wp.
    The documentation says about filters:

    the_content
        applied to the post content retrieved from the database, prior to printing on the screen (also used in some other operations, such as trackbacks).

    and

    the_excerpt
        applied to the post excerpt (or post content, if there is no excerpt) retrieved from the database, prior to printing on the screen (also used in some other operations, such as trackbacks).

    It appears that not only the_excerpt filters are run on the content if there is no excerpt, what is fine, but it works also the other way around: the the_content filters are run on the excerpt. and that is basically my problem. I will report that as a bug in wp.

  11. v2c
    Member
    Posted 2 years ago #

    Here is an example of a page where I am still just seeing [WPPA+ Photo display]

    http://montrealchoppers.com/galleries/arturo-thunder-gatti/

    Thanks again for your help!

  12. gustavoaperez10
    Member
    Posted 2 years ago #

    Hi, I am having the same problem it only displays [WPAA+ Photo display]

    it was working fine until y actualized the new version.

    http://www.gustavoaperez.com/galeria

    thank you

  13. Jacob N. Breetvelt
    Member
    Plugin Author

    Posted 2 years ago #

    Please update to wppa+ 3.1.5, and set the debug enable switch (Table IX item 5 in the Photo albums -> Settings page) on so that i can see what happens.
    It should work now...

  14. lupomontero
    Member
    Posted 2 years ago #

    Hi opajaap,

    Many thanks. The update fixed it!

  15. v2c
    Member
    Posted 2 years ago #

    Still no luck for me even with the update

  16. Jacob N. Breetvelt
    Member
    Plugin Author

    Posted 2 years ago #

    You may add to wppa_filter.php:

    $do_it = true;

    just before:

    if ($do_it) { // ($wppa['rendering_enabled'] || is_feed()) && !is_archive() &&!is_search()) {	// Insert the html
    				$post_new .= wppa_albums();
    			}
    			else {											// Or an indicator
    				if ($wppa['is_excerpt']) $post_new .= '[WPPA+ Photo display]';	// Tags will be stripped
    				else $post_new .= '<span style="color:blue; font-weight:bold; ">[WPPA+ Photo display]</span>';
    			}

    on line 175. It may cause problems if things happen like an excerpt in a meta tag. but it is worth trying

  17. v2c
    Member
    Posted 2 years ago #

    Seems to be working now, thanks for the help!

  18. v2c
    Member
    Posted 2 years ago #

    The "$do_it = true;" fix woked for me for many months but now it seems the slideshow does not work with this setting. When I remove "$do_it = true;" from wppa_filter.php I see "[WPAA+ Photo display]" once again. Any ideas for me?

    Thanks in advance

  19. Jacob N. Breetvelt
    Member
    Plugin Author

    Posted 2 years ago #

    I did not change a thing here in the code since the last time we talked about this (6 months ago?). Your link doesn't work at the moment.

  20. Jacob N. Breetvelt
    Member
    Plugin Author

    Posted 2 years ago #

    Maybe this helps:

    Right after wp_head(); in your themes header.php add:
    remove_filter('the_excerpt', 'strip_tags'); and leave the wppa+ code unchanged.

  21. v2c
    Member
    Posted 2 years ago #

    Sorry for the long delay, the code you provided didn't help, here is an active link;
    http://montrealchoppers.com/galleries/shriners-toy-ride/

    Thanks again for all your help

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic