WordPress.org

Ready to get started?Download WordPress

Forums

E Commerce Plugin shortcodes causing issues with Featured Image (1 post)

  1. approachd
    Member
    Posted 1 year ago #

    Hi Guys,

    I'm losing the plot with this issue.

    I have successfully installed and setup the getshopped ecommerce plugin as a ticketing solution for my site.

    It all works great except that whenever i use on of the pre-installed shortcodes for the getshopped plugin it removes the featured image from the page. It all works great until i add the shortcode on the bottom of the page.

    Does anyone have any idea what this could be down to?

    I presume that by adding the shortcode to the page i am messing up the following line of code and it is picking up the shortocde asscoaited image rather than the image for the event.

    Any help is hugely appreciated. Will even pay for help.

    Here is the tamplate code that is being used. The sample image is showing after adding the shortocde.

    <?php
                    if (has_post_thumbnail( $post->ID ))
                    {
    					$image_attributes = wp_get_attachment_image_src(get_post_thumbnail_id(), 'large');
                        echo '<img alt="' . $post->post_title . '" src="' . $image_attributes[0] . '" />';
                    }
    				else
    				{
    					if ($page_id == 45) {
    						echo '<img alt="' . $post->post_title . '" src="' . get_bloginfo("template_url") . '/images/' . $term->slug . '-default.png" />';
    					} else {
    						echo '<img alt="' . $post->post_title . '" src="' . get_bloginfo("template_url") . '/images/no-event-image.gif" />';
    					}
    				}
                    ?>

    [Moderator Note: Please post code or markup snippets between backticks or use the code button. As it stands, your posted code may now have been permanently damaged/corrupted by the forum's parser.]

Topic Closed

This topic has been closed to new replies.

About this Topic