Naomioneill
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Warning message on some of my blog pagesFixed!! Thank You Chandan!!
Forum: Fixing WordPress
In reply to: Warning message on some of my blog pagesIt still didn’t work Chandanonline4u.
Is there anything else I can try??
Forum: Fixing WordPress
In reply to: Warning message on some of my blog pagesThis is how my code looks when i add in the changes you both said.. am I doing it wrong?
[ Moderator Note: Please post code or markup snippets between backticks or use the code button. ]
<?php get_header(); /* get currently displayed category object ************************************************************************** */ $obj = get_queried_object(); /* get settings ************************************************************************** */ global $data; global $menupos; $postorder = $data['catp_order']; $topstyle = strtolower(str_replace(' ','',$data['catp_topstyle'])); $topsidebar = preg_replace("/[^0-9]/",'', $data['catp_topsidebar']); $topnum = preg_replace("/[^0-9]/",'', $data['catp_topnum']); $carousel = $data['catp_carousel']; $carouseltag = $data['catp_carouseltag']; $carouselnum = $data['catp_carouselnum']; $stylerest = strtolower(str_replace(' ','',$data['catp_reststyle'])); $restsidebar = preg_replace("/[^0-9]/", '', $data['catp_catsidebar']); $topsliderheight = preg_replace("/[^0-9]/", '', $data['catp_topsliderheight']); $restsliderheight = preg_replace("/[^0-9]/", '', $data['catp_restsliderheight']); $slideroverlap = $data['catp_slideroverlap']; $nopostsmessage = ''; $postclass = ''; /* modify query ************************************************************************** */ global $paged; global $query_string; global $wp_query; global $styleset; $qargs = array( 'paged' => $paged, 'post_type' => 'post' ); if($postorder == 'by date'){ $qrgs['orderby'] = 'date'; $qrgs['order'] = 'DESC'; } else { $qrgs['orderby'] = 'menu_order'; $qrgs['order'] = 'ASC'; } $nargs = array_merge( $wp_query->query, $qargs ); query_posts($nargs); /* collect tops ************************************************************************** */ $tops = array(); $car = array(); $rest = array(); $type = $styleset[$topstyle]['type']; $numtops = 4; if(in_array($type,array('slider','fullslider','carousel'))){ if($topnum >= 1){ $numtops = $topnum; } } // slider else { if($topsidebar !== ''){ $numtops = $numtops -1; } } // tilegroup if(have_posts()){ $i = 1; while ( have_posts() ) : the_post(); if($i <= $numtops){ $tops[] = $post; } else { $rest[] = $post; } $i ++; endwhile; }// have posts else { $nopostsmessage = '<div class="error"><p>'.__( 'Apologies, but no results were found for the requested archive. Perhaps searching will help find a related post.', 'loook' ).'</p>'.get_search_form(false).'</div>'; } wp_reset_query(); /* display top content ************************************************************************** */ ?> <!-- topcontent begin --> <div id="topcontent" class="loook_indextop clearfix post_<?php echo $postclass; ?>"> <?php $cardef = array( 'pageid' => 0, 'style' => 'style22', 'category' => $obj, 'blocktype' => 'cattiles', 'appearence' => 'catpages', 'blockheadline' => $carouseltag ); if(is_category() && !empty($obj)){ $def['category'] = $obj; } echo loook_dotilegroup($tops,$def); ?> </div><!--topcontent end--> <?php /* display main navigation if menu-position is set to 'below the content' ************************************************************************** */ if($data['menu_position'] == 'Below the top content' && !$menupos){ ?> </div><!--end contentwrap started in header.php--> <nav id="primary-nav" role="navigation" class="navbelow clearfix" data-title="<?php echo __('Navigate to ...','loook'); ?>"> <?php wp_nav_menu( array( 'theme_location' => 'primary-menu', 'depth' => 0, 'fallback_cb' => '', 'container' => 'div', 'container_class' => 'nojs') ); ?> </nav> <!-- start contentwrap again --> <div class="contentwrap clearfix relative"> <?php } ?> <?php if(is_category() && !empty($obj)){ /* carousel */ if($carousel && $carouseltag !== '' && $carouseltag !== 'Select a tag:'){ if($carouselnum <4){ $carouselnum = 8;} $cargs = array( 'tag' => $carouseltag, 'posts_per_page' => $carouselnum, 'category_name' => $obj->slug ); $carq = new WP_Query($cargs); $carposts = $carq->posts; wp_reset_postdata(); if(count($carposts) >= 4){ $cardef = array( 'pageid' => 0, 'style' => 'style22', 'category' => $obj, 'blocktype' => 'cattiles', 'appearence' => 'catpages', 'blockheadline' => '<a href="'.get_term_link($carouseltag,'post_tag').'">'.$carouseltag.'</a>', ); echo loook_dotilegroup($carposts,$cardef); } // has posts } // carousel active } // on category pages /* rest posts */ $cdef = array( 'pageid' => 0, 'style' => $stylerest, 'sidebar' => $restsidebar, 'topsliderheight' => $topsliderheight, 'catsliderheight' => $restsliderheight, 'fwslideroverlap' => $slideroverlap, 'blocktype' => 'cattiles', 'appearence' => 'nofront' ); if(is_category() && !empty($obj)){ $cdef['category'] = $obj; } if(!is_category()){ $cdef['noheadline'] = true; echo loook_breadcrumb(__($data['breadcrumb_prefix'],'loook'),__($data['breadcrumb_home'],'loook')); } echo $nopostsmessage; echo loook_dotilegroup($rest,$cdef); loook_pager(); get_footer(); ?>
Forum: Fixing WordPress
In reply to: Warning message on some of my blog pagesI tried changing those codes an this is what I got
Parse error: syntax error, unexpected ‘&’, expecting T_STRING or T_VARIABLE or ‘$’ in /home/naomikathreen/eatlikeanactress.com/wp-content/themes/loook/index.php on line 109
Forum: Fixing WordPress
In reply to: Warning message on some of my blog pagesOkay.. this is the code
[ Moderator Note: Please post code or markup snippets between backticks or use the code button. Or better still – use the pastebin ]
<?php get_header(); /* get currently displayed category object ************************************************************************** */ $obj = get_queried_object(); /* get settings ************************************************************************** */ global $data; global $menupos; $postorder = $data['catp_order']; $topstyle = strtolower(str_replace(' ','',$data['catp_topstyle'])); $topsidebar = preg_replace("/[^0-9]/",'', $data['catp_topsidebar']); $topnum = preg_replace("/[^0-9]/",'', $data['catp_topnum']); $carousel = $data['catp_carousel']; $carouseltag = $data['catp_carouseltag']; $carouselnum = $data['catp_carouselnum']; $stylerest = strtolower(str_replace(' ','',$data['catp_reststyle'])); $restsidebar = preg_replace("/[^0-9]/", '', $data['catp_catsidebar']); $topsliderheight = preg_replace("/[^0-9]/", '', $data['catp_topsliderheight']); $restsliderheight = preg_replace("/[^0-9]/", '', $data['catp_restsliderheight']); $slideroverlap = $data['catp_slideroverlap']; $nopostsmessage = ''; $postclass = ''; /* modify query ************************************************************************** */ global $paged; global $query_string; global $wp_query; global $styleset; $qargs = array( 'paged' => $paged, 'post_type' => 'post' ); if($postorder == 'by date'){ $qrgs['orderby'] = 'date'; $qrgs['order'] = 'DESC'; } else { $qrgs['orderby'] = 'menu_order'; $qrgs['order'] = 'ASC'; } $nargs = array_merge( $wp_query->query, $qargs ); query_posts($nargs); /* collect tops ************************************************************************** */ $tops = array(); $car = array(); $rest = array(); $type = $styleset[$topstyle]['type']; $numtops = 4; if(in_array($type,array('slider','fullslider','carousel'))){ if($topnum >= 1){ $numtops = $topnum; } } // slider else { if($topsidebar !== ''){ $numtops = $numtops -1; } } // tilegroup if(have_posts()){ $i = 1; while ( have_posts() ) : the_post(); if($i <= $numtops){ $tops[] = $post; } else { $rest[] = $post; } $i ++; endwhile; }// have posts else { $nopostsmessage = '<div class="error"><p>'.__( 'Apologies, but no results were found for the requested archive. Perhaps searching will help find a related post.', 'loook' ).'</p>'.get_search_form(false).'</div>'; } wp_reset_query(); /* display top content ************************************************************************** */ ?> <!-- topcontent begin --> <div id="topcontent" class="loook_indextop clearfix post_<?php echo $postclass; ?>"> <?php $def = array( 'pageid' => 0, 'style' => $topstyle, 'sidebar' => $topsidebar, 'topsliderheight' => $topsliderheight, 'catsliderheight' => $restsliderheight, 'fwslideroverlap' => $slideroverlap, 'blocktype' => 'toptiles', 'appearence' => 'catpages' ); if(is_category() && !empty($obj)){ $def['category'] = $obj; } echo loook_dotilegroup($tops,$def); ?> </div><!--topcontent end--> <?php /* display main navigation if menu-position is set to 'below the content' ************************************************************************** */ if($data['menu_position'] == 'Below the top content' && !$menupos){ ?> </div><!--end contentwrap started in header.php--> <nav id="primary-nav" role="navigation" class="navbelow clearfix" data-title="<?php echo __('Navigate to ...','loook'); ?>"> <?php wp_nav_menu( array( 'theme_location' => 'primary-menu', 'depth' => 0, 'fallback_cb' => '', 'container' => 'div', 'container_class' => 'nojs') ); ?> </nav> <!-- start contentwrap again --> <div class="contentwrap clearfix relative"> <?php } ?> <?php if(is_category() && !empty($obj)){ /* carousel */ if($carousel && $carouseltag !== '' && $carouseltag !== 'Select a tag:'){ if($carouselnum <4){ $carouselnum = 8;} $cargs = array( 'tag' => $carouseltag, 'posts_per_page' => $carouselnum, 'category_name' => $obj->slug ); $carq = new WP_Query($cargs); $carposts = $carq->posts; wp_reset_postdata(); if(count($carposts) >= 4){ $cardef = array( 'pageid' => 0, 'style' => 'style22', 'category' => $obj, 'blocktype' => 'cattiles', 'appearence' => 'catpages', 'blockheadline' => '<a href="'.get_term_link($carouseltag,'post_tag').'">'.$carouseltag.'</a>', ); echo loook_dotilegroup($carposts,$cardef); } // has posts } // carousel active } // on category pages /* rest posts */ $cdef = array( 'pageid' => 0, 'style' => $stylerest, 'sidebar' => $restsidebar, 'topsliderheight' => $topsliderheight, 'catsliderheight' => $restsliderheight, 'fwslideroverlap' => $slideroverlap, 'blocktype' => 'cattiles', 'appearence' => 'nofront', ); if(is_category() && !empty($obj)){ $cdef['category'] = $obj; } if(!is_category()){ $cdef['noheadline'] = true; echo loook_breadcrumb(__($data['breadcrumb_prefix'],'loook'),__($data['breadcrumb_home'],'loook')); } echo $nopostsmessage; echo loook_dotilegroup($rest,$cdef); loook_pager(); get_footer(); ?>
Forum: Fixing WordPress
In reply to: Warning message on some of my blog pagesWhere would I find the code?
Forum: Fixing WordPress
In reply to: Warning message on some of my blog pagesHi t-p ! Thanks for the advice but I just tried that and it didnt work.. the message is still there.. is there something else I should try??!