• 0

WordPress Image Slider, Alignment in PHP


Question

Hi All,

I have a Wordpress site that has Front Page Slider installed, this is working as expected and the front page shows me the slider in the correct position on the front page where i want it.

I have adjusted the width of it so that it is smaller than the width of the front page as i would like to position some html to its immediate right, in line with the slider.

The front page is made up of a number of PHP calls, like so:-

<?php get_header() ;?>

<?php echo do_shortcode('[FrontpageSlideshow]');?>

<?php include (TEMPLATEPATH . '/includes/get_blogs.php');?>

<?php include (TEMPLATEPATH . '/includes/get_home_widgets.php');?>

<?php get_footer() ;?>

and that's it.

If i insert a simple piece of HTML after the <?php echo do_shortcode('[FrontpageSlideshow]');?> it appears after the slideshow and not alongside, which i expected to be honest.

However i cant work out how to get it in line with the slideshow so that the HTML appears to its immediate right as opposed to underneath it.

My template has shortcodes for positioning like [one_half] and [one_half_last] which i tried to call to position the slideshow in the first half of the page and the html in the second half but i didn't have much success, i suspect a table may be what i need but, as you probably have gathered i'm no PHP expert.

Do you have any ideas or could somebody point me in the right direction here?

Thanks

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

Css controls positioning.

wrap the text in a div

 &lt;div id="text"&gt;blah blah blah&lt;/div&gt;

then in your themes style sheet (usually style.css in your theme folder) you need to give it styles:

#text{
float:left;
}

you would also need to check if the image slider has any styles which may prevent the text aligning next to it (clear:both; would prevent you floating next to it).

view your source code in the browser and see if there are any divs wrapped around the images and edit the css for these. seeing as you said the image slider was a plugin the styles might be in a different stylesheet so check in the plugin folder.

Link to comment
Share on other sites

  • 0

Css controls positioning.

wrap the text in a div

 &lt;div id="text"&gt;blah blah blah&lt;/div&gt;

then in your themes style sheet (usually style.css in your theme folder) you need to give it styles:

#text{
float:left;
}

you would also need to check if the image slider has any styles which may prevent the text aligning next to it (clear:both; would prevent you floating next to it).

view your source code in the browser and see if there are any divs wrapped around the images and edit the css for these. seeing as you said the image slider was a plugin the styles might be in a different stylesheet so check in the plugin folder.

Thanks mate! Worked a treat! :woot:

Well, that in conjunction with a position:relative; and a bit of pixel tweaking.

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.