WordPress.org

Ready to get started?Download WordPress

Forums

ADD image to customized sidebar to ONE PAGE! (22 posts)

  1. Victoria Rose
    Member
    Posted 8 months ago #

    Ok here is my big problem : Adding an image to the right sidebar on one page.

    I am trying to add an image to this page: http://epiphanysws.com/shale%20gas/

    I tried posting the map into the page itself and aligning it to the right, but that did not work as you can clearly see.

    Someone else worked on this website before I did, and being that I am totally new to WordPress, I have NO IDEA what they did to the sidebar!

    There is a sidebar.php template, and a rtsidebar.php template created in the editor.
    (I'm assuming they did all their editing here since the there is no sidebar widget to use either.)

    In the rtsidebar.php, there is a lot of this code going on:

    <div id="sidebar_rt" role="complementary">
    <?php if(is_front_page() || is_page(40) || is_page(43)) { ?>

    With that being said, I can see that there are different sidebar's made for pages, but I cannot seem to figure out the right code for the page I am working with.

    If this makes any sense to anyone else PLEASE HELP ME! Again, I am very new to this, so I am jumping right into the code disaster that is on this website.

    Please Note: I cannot change the theme or add any plugins that might mess up the current sidebar.

    Here is a link to the site so you can see everything else that his been done on the pages: http://epiphanysws.com/
    The theme is Twenty Ten. Version 1.1

    THANK YOU!

  2. Lorenzo Orlando Caum
    Member
    Posted 8 months ago #

    I see that you mentioned Twenty Ten.

    I'm not sure how much custom coding is in use in the theme but have you considered using a plugin like Display Widgets or Widget Logic?

    http://wordpress.org/plugins/display-widgets/
    http://wordpress.org/plugins/widget-logic/

    Both will let you assign widgets to certain pages or posts using WP-admin --> Appearance --> Widgets

  3. Victoria Rose
    Member
    Posted 8 months ago #

    Lorenzo Orlando Caum- I know, I have thought about this already, but I have read in some reviews that if I install one of these plugins it can wipe out the existing sidebars that have already been customized for the other pages.....is this true?

    I only want to change one sidebar-for the shale gas page- so I am afraid I will screw everything else up!

  4. Victoria Rose
    Member
    Posted 8 months ago #

    Does anyone else know how to help me?

    I'm assuming I have to do everything in the Editor and change/add code to the php template of rtsidebar.php which was already created.

    I just don't know where to put the code and how to set it up!

    PLEASE HELP!!!!!

  5. Lorenzo Orlando Caum
    Member
    Posted 8 months ago #

    I have not experienced that issue but you can temporarily move the widgets to inactive.

    Then move them back into place once you are running one of those plugins.

    The code sample that you posted from rtsidebar.php appears to be using WordPress conditionals.

    Display Widgets allows you to do this without having to manually enter in these conditionals.

    Take a look at this short video: http://wordpress.tv/2013/05/01/using-the-display-widgets-plugin/

  6. Victoria Rose
    Member
    Posted 8 months ago #

    Hmmm...Thanks Lorenzo!

    I'm still confused...

    If I were to download this plugin, would the sidebar show up? Because as of now I do not have a sidebar widget?

  7. WPyogi
    Volunteer Moderator
    Posted 8 months ago #

    Have you tried the plugin? With such a customized theme, help on these forums is quite limited.

  8. Victoria Rose
    Member
    Posted 8 months ago #

    Sorry for the repeated thread earlier... :(

    And no I haven't tried it yet because I am afraid of losing all the customization of the sidebars that are in use!

  9. WPyogi
    Volunteer Moderator
    Posted 8 months ago #

    That's a good concern - I'd suggest you make a full backup of the site before doing anything else -

    http://codex.wordpress.org/WordPress_Backups

    Who set up this site/theme? Have you asked them for help with this?

  10. Victoria Rose
    Member
    Posted 8 months ago #

    I am a new employee with a business, and they do not have any records to give me of who started the site.
    Plus I have never used WordPress before, up until now, so I am trying to find my way through all their custom adjustments by merely looking up questions/suggestions through this WordPress Support.

    Sigh. I have been at this for days. Frustrating to say the least.

    Thank you for your help and responding, WPyogi! :)

  11. Victoria Rose
    Member
    Posted 8 months ago #

    Parse error: syntax error, unexpected $end in /home/content/84/6732684/html/wp-content/themes/twentyten/rtsidebar.php on line 131

    THIS is the error I get when I put in this code into the rtsidebar.php of this website: http://epiphanysws.com/shale%20gas/

    <?php if(is_page(44)) { ?>
    
    <div class="callout_right">
    <img src="http://epiphanysws.com/wp-content/uploads/2013/10/MAPSHALEGAS.jpg" width="300" height="196 alt="text alternative" />
    </div>

    [Moderator Note: Please post code & markup between backticks or use the code button. Your posted code may now have been permanently damaged by the forum's parser.]

    Now all my sidebars are like this! HELP!

    What am I doing wrong with the code????

  12. WPyogi
    Volunteer Moderator
    Posted 8 months ago #

    Hey Victoria - It's certainly understandable that this is very frustrating, but the problem is that no one here has any idea how that theme/site has been set up and modified.

    If the version number is correct, it's also 3 years old - and that MIGHT be problematic as well. You should also be aware that if WP is updated, it will likely overwrite all the changes made to a default theme - twentyten is one of them. So be very cautious about doing that.

    Any chance that your employers could hire someone experienced with WP to help you with this?

  13. Victoria Rose
    Member
    Posted 8 months ago #

    They have asked me to become an expert in it :)

    So that is why I am asking people on here for help,since I do not know of any other avenue for calling for online support/skype/over the phone help/ect...

    I can see how the rest of the sidebars are laid out in the rtsidebar.php, but just can't find the right way to write the code for a new page!

    There are separate loops created as well, and perhaps that is how they made this possible before?

    Not sure. Oh well...I'll keep digging through it.

  14. alchymyth
    The Sweeper & Moderator
    Posted 8 months ago #

    the parse error might be from an unclosed } of the if statement;

    if in doubt, please post the full code of rtsidebar.php

    - please use the pastebin as described in http://codex.wordpress.org/Forum_Welcome#Posting_Code

  15. Victoria Rose
    Member
    Posted 8 months ago #

    Thank You alchymyth! Sorry I'm new to all this....

    The full code of the rtsidebar.php is this....

    <div id="sidebar_rt" role="complementary">
            <?php if(is_front_page() || is_page(40) || is_page(43)) { ?>
    
            <div class="callout_right">
            <img src="<?php bloginfo('template_url'); ?>/images/highlights/tab_view.png" class="tabbed" />
            <img src="<?php bloginfo('template_url'); ?>/images/container_top.jpg" class="fltleft" />
                <div class="content" style="cursor: pointer;" onClick="window.location.href='<?php bloginfo('url'); ?>/scarcity'">
                <img src="<?php bloginfo('template_url'); ?>/images/highlights/map.jpg" />
                <p>Areas of Physical and Economical Water Scarcity Map Courtesy of IWMI, 2007. <br /> http://maps.grida.no/go/graphic/areas-of-physical-and-economic-water-scarcity</p>
                </div>
            <img src="<?php bloginfo('template_url'); ?>/images/container_bottom.jpg" class="fltleft" />
            </div>
    
            <div class="callout_right">
            <img src="<?php bloginfo('template_url'); ?>/images/highlights/tab_uses.png" class="tabbed" />
            <img src="<?php bloginfo('template_url'); ?>/images/container_top.jpg" class="fltleft" />
                <div class="content">
                <img src="<?php bloginfo('template_url'); ?>/images/highlights/satellite.jpg" />
                <h3>Potential uses for this technology are countless.  Some primary uses include:</h3>
                <ul class="uses">
                	<li>Personal/Home Use</li>
                    <li>Greywater Reclemation</li>
                    <li>Commercial/Industrial/<br />Municipal Drinking Water Production</li>
                    <li>Desalination</li>
                </ul>
                </div>
            <img src="<?php bloginfo('template_url'); ?>/images/container_bottom.jpg" class="fltleft" />
            </div>
    
            <div class="rec-news">
            recent news
            <div style="height: 3px; width:100%; display: block; background-color:#008db3; margin-top: 5px;"></div>
    			<?php $my_query = new WP_Query('showposts=3&cat=4'); ?>
                <?php while ($my_query->have_posts()) : $my_query->the_post(); ?>
                <div class="recent">
                <h3><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h3>
                </div>
                <?php endwhile; ?>
                <a href="<?php bloginfo('url');?>/news" style="color:#065e77;">MORE NEWS</a>
            </div>
    
            <?php } else if(is_page(2) || is_page(45) || is_page(47) || is_page(50) || is_page(53)) { ?>
    
            <div class="callout_right" style="cursor: pointer;" onClick="window.location.href='<?php bloginfo('url'); ?>/technology'">
            <img src="<?php bloginfo('template_url'); ?>/images/highlights/tab_view.png" class="tabbed" />
            <img src="<?php bloginfo('template_url'); ?>/images/container_top.jpg" class="fltleft" />
                <div class="content">
                <img src="<?php bloginfo('template_url'); ?>/images/highlights/how.jpg" />
                </div>
            <img src="<?php bloginfo('template_url'); ?>/images/container_bottom.jpg" class="fltleft" />
            </div>
    
            <div class="team">
            meet the epiphany team
            <div style="height: 3px; width:100%; display: block; background-color:#008db3; padding:0; margin-top: 5px;"></div>
            <div>
            	<a href="<?php bloginfo('url'); ?>/about/ron "onMouseOver="document.getElementById('ron-title').className = 'showing' "onMouseOut="document.getElementById('ron-title').className = ''">
            		<img src="<?php bloginfo('template_url'); ?>/images/ron.jpg" alt="Ron Pettengill" />
            	</a>
            </div>
            <div class="member">
            	<a href="<?php bloginfo('url'); ?>/about/tom "onMouseOver="document.getElementById('tom-title').className = 'showing' "onMouseOut="document.getElementById('tom-title').className = ''">
    	        	<img src="<?php bloginfo('template_url'); ?>/images/tom.jpg" alt="Tom Joseph" />
    	        </a>
            </div>
            <div class="member">
    	        <a href="<?php bloginfo('url'); ?>/about/mike "onMouseOver="document.getElementById('mike-title'). className = 'showing' "onMouseOut="document.getElementById('mike-title').className = ''">
    	        	<img src="<?php bloginfo('template_url'); ?>/images/mike.jpg" alt="Mike Broeker" />
    	        </a>
    	</div>
    	<div class="member">
    		<a href="<?php bloginfo('url'); ?>/about/henry "onMouseOver="document.getElementById('henry-title').className = 'showing' "onMouseOut="document.getElementById('henry-title').className = ''">
    	        	<img src="<?php bloginfo('template_url'); ?>/images/henry.jpg" alt="Henry Wandrie" />
    	        </a>
            </div>
            	<span id="ron-title">
            		<img src="<?php bloginfo('template_url'); ?>/images/title-ron.png" alt="Ron Pettengill" />
            	</span>
    		<span id="tom-title">
            		<img src="<?php bloginfo('template_url'); ?>/images/title-tom.png" alt="Tom Joseph" />
            	</span>
            	<span id="mike-title">
            		<img src="<?php bloginfo('template_url'); ?>/images/mike1.png" alt="Mike Broeker" />
            	</span>
            	<span id="henry-title">
            		<img src="<?php bloginfo('template_url'); ?>/images/title-henry.png" alt="Henry Wandrie" />
            	</span>
    	</div>
    
    		<div class="partners">
            partners of epiphany
            <div style="height: 3px; width:100%; display: block; background-color:#065e77; margin-top: 5px;"></div>
            <img src="<?php bloginfo('template_url'); ?>/images/highlights/eviive.jpg" class="fltright" />
            <a href="http://www.chesterengineers.com/" target="_blank"?><img src="<?php bloginfo('template_url'); ?>/images/highlights/chester.jpg" class="fltright" style="margin-right: 15px;" /></a>
            <a href="http://www.bayermaterialscience.com/internet/global_portal_cms.nsf/id/home_en" target="_blank"?><img src="<?php bloginfo('template_url'); ?>/images/highlights/bayer.jpg" class="fltright" /></a>
            </div>
            <?php } else if(is_category(4) || in_category(4)) { ?>
    
            <div class="rec-news">
            recent news
            <div style="height: 3px; width:100%; display: block; background-color:#008db3; padding:0; margin-top: 5px;"></div>
    			<?php $my_query = new WP_Query('showposts=5&cat=4'); ?>
                <?php while ($my_query->have_posts()) : $my_query->the_post(); ?>
                <div class="recent">
                <h3><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h3>
                </div>
                            <?php endwhile; ?>
            </div>
    
            <?php } ?>
    		</div><!-- #sidebar_rt -->

    I hope I did that correctly....

  16. alchymyth
    The Sweeper & Moderator
    Posted 8 months ago #

    the posted code only has 111 lines -

    please post the code that created the error message with 'Parse error: syntax error, unexpected $end in /home/content/84/6732684/html/wp-content/themes/twentyten/rtsidebar.php on line 131'

  17. Victoria Rose
    Member
    Posted 8 months ago #

    I already deleted the code I made before because it gave me that error :(

  18. alchymyth
    The Sweeper & Moderator
    Posted 8 months ago #

    to find out what caused the error and to fix it, I would need to see the 'broken' code.

    generally, the if statement in your snippet would need to be closed:

    <?php if(is_page(44)) { ?>
    
    <div class="callout_right">
    <img src="http://epiphanysws.com/wp-content/uploads/2013/10/MAPSHALEGAS.jpg" width="300" height="196 alt="text alternative" />
    </div>
    
    <?php } ?>

    http://php.net/manual/en/control-structures.if.php

  19. Victoria Rose
    Member
    Posted 8 months ago #

    I tried the code with it being closed, and it erased the error, but no image came up.

    I think there is a loop? Or something else that I am missing to link the image to the page.

  20. alchymyth
    The Sweeper & Moderator
    Posted 8 months ago #

    your site does not seem to have a page with the ID of 44; double-check the page id or use the page name or title in the is_page() code;
    http://codex.wordpress.org/Function_Reference/is_page

  21. Andrew
    Forum Moderator
    Posted 8 months ago #

  22. Victoria Rose
    Member
    Posted 8 months ago #

    Ok-- I'm going to paste in the whole code for the sidebar.php...and the rtsidebar.php......

    If anyone can tell me how to add an image to one of the pages on the right side bar, based on this code, I would really appreciate your help.

    <?php
    /**
     * The Sidebar containing the primary and secondary widget areas.
     *
     * @package WordPress
     * @subpackage Twenty_Ten
     * @since Twenty Ten 1.0
     */
    ?>
    
    		<div id="navigation" class="widget-area" role="complementary">
            <a href="<?php bloginfo('url'); ?>"><img src="<?php bloginfo('template_url'); ?>/images/logo.png" alt="Epiphany Laboratories" /></a>
    			<ul class="xoxo">
    				<li class="navparent"><a href="<?php bloginfo('url'); ?>" class="navlink<?php if(is_front_page()) { echo("-active"); } ?>">home<br /><span class="secondary">back to the front</span></a></li>
                    <li class="navparent"><a href="<?php bloginfo('url'); ?>/the-problem" class="navlink<?php if(is_page(40)) { echo("-active"); } ?>">the problem<br /><span class="secondary">expected to double by 2025</span></a></li>
                    <li class="navparent"><a href="<?php bloginfo('url'); ?>/solution" class="navlink<?php if(is_page(43)) { echo("-active"); } ?>">the solution<br /><span class="secondary">addressing the issue</span></a></li>
    		<li class="navparent"><a href="<?php bloginfo('url'); ?>/shale gas" class="navlink<?php if(is_page(44)) { echo("-active"); } ?>">shale gas<br /><span class="secondary">production water</span></a></li>
    
                    <li class="navparent"><a href="<?php bloginfo('url'); ?>/about" class="navlink<?php if(is_page(2)) { echo("-active"); } ?>">about<br /><span class="secondary">epiphany information</span></a></li>
                    <li class="navparent"><a href="<?php bloginfo('url'); ?>/technology" class="navlink<?php if(is_page(9)) { echo("-active"); } ?>">technology<br /><span class="secondary">how it works</span></a></li>
                    <li class="navparent"><a href="<?php bloginfo('url'); ?>/news" class="navlink<?php if(is_category(4) || in_category(4)) { echo("-active"); } ?>">news<br /><span class="secondary">the latest progress</span></a></li>
                    <li class="navparent"><a href="<?php bloginfo('url'); ?>/contact" class="navlink<?php if(is_page(11)) { echo("-active"); } ?>">contact<br /><span class="secondary">get in touch with epiphany</span></a></li>
    			</ul>
    		</div><!-- #navigation .widget-area -->

    and here is the rtsidebar.php ....

    <?php
    /**
     * The Sidebar containing the primary and secondary widget areas.
     *
     * @package WordPress
     * @subpackage Twenty_Ten
     * @since Twenty Ten 1.0
     */
    ?>
    
    		<div id="sidebar_rt" role="complementary">
            <?php if(is_front_page() || is_page(40) || is_page(43)) { ?>
    
            <div class="callout_right">
            <img src="<?php bloginfo('template_url'); ?>/images/highlights/tab_view.png" class="tabbed" />
            <img src="<?php bloginfo('template_url'); ?>/images/container_top.jpg" class="fltleft" />
                <div class="content" style="cursor: pointer;" onClick="window.location.href='<?php bloginfo('url'); ?>/scarcity'">
                <img src="<?php bloginfo('template_url'); ?>/images/highlights/map.jpg" />
                <p>Areas of Physical and Economical Water Scarcity Map Courtesy of IWMI, 2007. <br /> http://maps.grida.no/go/graphic/areas-of-physical-and-economic-water-scarcity</p>
                </div>
            <img src="<?php bloginfo('template_url'); ?>/images/container_bottom.jpg" class="fltleft" />
            </div>
    
            <div class="callout_right">
            <img src="<?php bloginfo('template_url'); ?>/images/highlights/tab_uses.png" class="tabbed" />
            <img src="<?php bloginfo('template_url'); ?>/images/container_top.jpg" class="fltleft" />
                <div class="content">
                <img src="<?php bloginfo('template_url'); ?>/images/highlights/satellite.jpg" />
                <h3>Potential uses for this technology are countless.  Some primary uses include:</h3>
                <ul class="uses">
                	<li>Personal/Home Use</li>
                    <li>Greywater Reclemation</li>
                    <li>Commercial/Industrial/<br />Municipal Drinking Water Production</li>
                    <li>Desalination</li>
                </ul>
                </div>
            <img src="<?php bloginfo('template_url'); ?>/images/container_bottom.jpg" class="fltleft" />
            </div>
    
            <div class="rec-news">
            recent news
            <div style="height: 3px; width:100%; display: block; background-color:#008db3; margin-top: 5px;"></div>
    			<?php $my_query = new WP_Query('showposts=3&cat=4'); ?>
                <?php while ($my_query->have_posts()) : $my_query->the_post(); ?>
                <div class="recent">
                <h3><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h3>
                </div>
                <?php endwhile; ?>
                <a href="<?php bloginfo('url');?>/news" style="color:#065e77;">MORE NEWS</a>
            </div>
    
            <?php } else if(is_page(2) || is_page(45) || is_page(47) || is_page(50) || is_page(53)) { ?>
    
            <div class="callout_right" style="cursor: pointer;" onClick="window.location.href='<?php bloginfo('url'); ?>/technology'">
            <img src="<?php bloginfo('template_url'); ?>/images/highlights/tab_view.png" class="tabbed" />
            <img src="<?php bloginfo('template_url'); ?>/images/container_top.jpg" class="fltleft" />
                <div class="content">
                <img src="<?php bloginfo('template_url'); ?>/images/highlights/how.jpg" />
                </div>
            <img src="<?php bloginfo('template_url'); ?>/images/container_bottom.jpg" class="fltleft" />
            </div>
    
            <div class="team">
            meet the epiphany team
            <div style="height: 3px; width:100%; display: block; background-color:#008db3; padding:0; margin-top: 5px;"></div>
            <div>
            	<a href="<?php bloginfo('url'); ?>/about/ron "onMouseOver="document.getElementById('ron-title').className = 'showing' "onMouseOut="document.getElementById('ron-title').className = ''">
            		<img src="<?php bloginfo('template_url'); ?>/images/ron.jpg" alt="Ron Pettengill" />
            	</a>
            </div>
            <div class="member">
            	<a href="<?php bloginfo('url'); ?>/about/tom "onMouseOver="document.getElementById('tom-title').className = 'showing' "onMouseOut="document.getElementById('tom-title').className = ''">
    	        	<img src="<?php bloginfo('template_url'); ?>/images/tom.jpg" alt="Tom Joseph" />
    	        </a>
            </div>
            <div class="member">
    	        <a href="<?php bloginfo('url'); ?>/about/mike "onMouseOver="document.getElementById('mike-title'). className = 'showing' "onMouseOut="document.getElementById('mike-title').className = ''">
    	        	<img src="<?php bloginfo('template_url'); ?>/images/mike.jpg" alt="Mike Broeker" />
    	        </a>
    	</div>
    	<div class="member">
    		<a href="<?php bloginfo('url'); ?>/about/henry "onMouseOver="document.getElementById('henry-title').className = 'showing' "onMouseOut="document.getElementById('henry-title').className = ''">
    	        	<img src="<?php bloginfo('template_url'); ?>/images/henry.jpg" alt="Henry Wandrie" />
    	        </a>
            </div>
            	<span id="ron-title">
            		<img src="<?php bloginfo('template_url'); ?>/images/title-ron.png" alt="Ron Pettengill" />
            	</span>
    		<span id="tom-title">
            		<img src="<?php bloginfo('template_url'); ?>/images/title-tom.png" alt="Tom Joseph" />
            	</span>
            	<span id="mike-title">
            		<img src="<?php bloginfo('template_url'); ?>/images/mike1.png" alt="Mike Broeker" />
            	</span>
            	<span id="henry-title">
            		<img src="<?php bloginfo('template_url'); ?>/images/title-henry.png" alt="Henry Wandrie" />
            	</span>
    	</div>
    
    		<div class="partners">
            partners of epiphany
            <div style="height: 3px; width:100%; display: block; background-color:#065e77; margin-top: 5px;"></div>
            <img src="<?php bloginfo('template_url'); ?>/images/highlights/eviive.jpg" class="fltright" />
            <a href="http://www.chesterengineers.com/" target="_blank"?><img src="<?php bloginfo('template_url'); ?>/images/highlights/chester.jpg" class="fltright" style="margin-right: 15px;" /></a>
            <a href="http://www.bayermaterialscience.com/internet/global_portal_cms.nsf/id/home_en" target="_blank"?><img src="<?php bloginfo('template_url'); ?>/images/highlights/bayer.jpg" class="fltright" /></a>
            </div>
            <?php } else if(is_category(4) || in_category(4)) { ?>
    
            <div class="rec-news">
            recent news
            <div style="height: 3px; width:100%; display: block; background-color:#008db3; padding:0; margin-top: 5px;"></div>
    			<?php $my_query = new WP_Query('showposts=5&cat=4'); ?>
                <?php while ($my_query->have_posts()) : $my_query->the_post(); ?>
                <div class="recent">
                <h3><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h3>
                </div>
                <?php endwhile; ?>
            </div>
    
            <?php } ?>
    
    		</div><!-- #sidebar_rt -->

    Thank you to anyone who is reading this!

Reply

You must log in to post.

About this Topic