RE: [PHP] PHP code problem with pages
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 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP code problem with pages
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: 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
Re: [PHP] PHP code problem with pages
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/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] code problem
This is my code... ?php require_once('Connections/ross.php'); ? ?php $maxRows_Recordset1 = 10; $pageNum_Recordset1 = 0; if (isset($_GET['pageNum_Recordset1'])) { $pageNum_Recordset1 = $_GET['pageNum_Recordset1']; } $startRow_Recordset1 = $pageNum_Recordset1 * $maxRows_Recordset1; mysql_select_db($database_ross, $ross); $query_Recordset1 = SELECT portfolio.location_name FROM portfolio; $query_limit_Recordset1 = sprintf(%s LIMIT %d, %d, $query_Recordset1, $startRow_Recordset1, $maxRows_Recordset1); $Recordset1 = mysql_query($query_limit_Recordset1, $ross) or die(mysql_error()); $row_Recordset1 = mysql_fetch_assoc($Recordset1); if (isset($_GET['totalRows_Recordset1'])) { $totalRows_Recordset1 = $_GET['totalRows_Recordset1']; } else { $all_Recordset1 = mysql_query($query_Recordset1); $totalRows_Recordset1 = mysql_num_rows($all_Recordset1); } $totalPages_Recordset1 = ceil($totalRows_Recordset1/$maxRows_Recordset1)-1; mysql_free_result($Recordset1); ? ?php echo $totalRows_Recordset1 ? ?php do { ? p?php echo $row_Recordset1['location_name']; ?/p ?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ? It displays one result then thows up the following error Warning: mysql_fetch_assoc(): 3 is not a valid MySQL result resource in c:\inetpub\wwwroot\testy\Untitled-1.php on line 29 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] code problem
Ross Hulford wrote: This is my code... [snip] mysql_free_result($Recordset1); ... ?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ? It displays one result then thows up the following error Warning: mysql_fetch_assoc(): 3 is not a valid MySQL result resource in c:\inetpub\wwwroot\testy\Untitled-1.php on line 29 You free the result and then try to fetch more rows from it... not going to work. -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals www.phparch.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php