php-general Digest 22 Jan 2012 14:46:38 -0000 Issue 7660

Topics (messages 316352 through 316353):

Re: PHP code problem with pages
        316352 by: Daniel Brown
        316353 by: HallMarc Websites

Administrivia:

To subscribe to the digest, e-mail:
        php-general-digest-subscr...@lists.php.net

To unsubscribe from the digest, e-mail:
        php-general-digest-unsubscr...@lists.php.net

To post to the list, e-mail:
        php-gene...@lists.php.net


----------------------------------------------------------------------
--- Begin Message ---
On Sat, Jan 21, 2012 at 20:07, Carlos Sura <carlos.su...@googlemail.com> wrote:
> Hello Mates,
>
> Maybe my subject line is not descriptive as I wish, but I just did not know
> how to put on it.
>
> I have the following problem, I'm using jQuery to make a slide effect
> (horizontal), everything seems to be working find, but I have to add a mask
> with a white color background, I did this by CSS, now I have 6 pages in
> total, this is managed by wp anyway, it shows the white bakground mask in
> every page, and I want it to show in every page but not the home page;
> since I'm using a slider effect and a container, it became very difficult
> to me, maybe any of you can explain me a way to a easy fix, I will show you
> the lines of code:

    This is probably better answered via a WordPress support venue,
but you can try this:

        if ($_SERVER['PHP_SELF'] == 'the name of your index file') {
            // Load alternate styling here
        } else {
            // Do your primary styling
        }



> <div id="wrapper">
> <div id="mask">
> <?php $pages = list_all_pages(); ?>
>
> <?php
> //Get first and last page ID
> $cnt = 0;
> foreach($pages as $page) {
> $post_keys = get_post_custom_values('section_id', $page->ID);
> $post_key[$cnt] = $post_keys[0];
> $cnt++;
> }
> ?>
>
> <?php
> $cnt = 0;
> foreach($pages as $page) {
> $post_keys = get_post_custom_values('section_id', $page->ID);
> ?>
>  <div class="item <?php if(($jxfs_transition == 'horizontal_vertical' &&
> $cnt%2 == 0) || ($jxfs_transition == 'horizontal')) { echo 'fl';} ?>"
> id="<?php echo $post_keys[0]; ?>">
> <div class="content">
> <?php
> $page_content = get_page($page->ID);
> ?>
>  <ul class="container">         //This is the container with the white
> background.
> <li class='grid_820'>
> <?php
> echo do_shortcode($page_content->post_content);
> ?>
> </li>
>
>
> As you can see, I'm using this for all pages, I was trying to use another
> template-code to tell wordpress that home page uses another page as home,
> but it does not work for some reason. Anyway, help will be appreciated.
>
> --
> Carlos Sura.-
> www.carlossura.com



-- 
</Daniel P. Brown>
Network Infrastructure Manager
http://www.php.net/

--- End Message ---
--- Begin Message ---
> 
> Maybe my subject line is not descriptive as I wish, but I just did not
know
> how to put on it.
> 
> I have the following problem, I'm using jQuery to make a slide effect
> (horizontal), everything seems to be working find, but I have to add a
mask
> with a white color background, I did this by CSS, now I have 6 pages in
total,
> this is managed by wp anyway, it shows the white bakground mask in every
> page, and I want it to show in every page but not the home page; 
[>] 

Carlos, this looks like it would better suit your support needs to post this
question on the wordpress.org forums. Here is what I can tell you, you need
to make use of the functions built into WP and the theme you are using. The
function(s) you need to use are as such:
is_front_page();
is_home_page();
is_page();
etc and you can find the documentation in the Wordpress Codex here
http://codex.wordpress.org/Conditional_Tags 

You could, alternatively, create your slider as a plugin; create a shortcode
hook, and then call the sliders to the page with the shortcode in the
dashboard WYSIWYG for that page/post.

Marc Hall
HallMarc Websites


--- End Message ---

Reply via email to