Taro
Forum Replies Created
-
Forum: Hacks
In reply to: Re: Search result based on menu categoryintro page
WP_Query Object ( [query] => Array ( ) [query_vars] => Array ( [error] => [m] => [p] => 0 [post_parent] => [subpost] => [subpost_id] => [attachment] => [attachment_id] => 0 [name] => [static] => [pagename] => [page_id] => 2580 [second] => [minute] => [hour] => [day] => 0 [monthnum] => 0 [year] => 0 [w] => 0 [category_name] => [tag] => [cat] => [tag_id] => [author] => [author_name] => [feed] => [tb] => [paged] => 0 [meta_key] => [meta_value] => [preview] => [s] => [sentence] => [title] => [fields] => [menu_order] => [embed] => [category__in] => Array ( ) [category__not_in] => Array ( ) [category__and] => Array ( ) [post__in] => Array ( ) [post__not_in] => Array ( ) [post_name__in] => Array ( ) [tag__in] => Array ( ) [tag__not_in] => Array ( ) [tag__and] => Array ( ) [tag_slug__in] => Array ( ) [tag_slug__and] => Array ( ) [post_parent__in] => Array ( ) [post_parent__not_in] => Array ( ) [author__in] => Array ( ) [author__not_in] => Array ( ) ) [tax_query] => WP_Tax_Query Object ( [queries] => Array ( ) [relation] => AND [table_aliases:protected] => Array ( ) [queried_terms] => Array ( ) [primary_table] => [primary_id_column] => ) [meta_query] => [date_query] => [post_count] => 0 [current_post] => -1 [in_the_loop] => [comment_count] => 0 [current_comment] => -1 [found_posts] => 0 [max_num_pages] => 0 [max_num_comment_pages] => 0 [is_single] => [is_preview] => [is_page] => 1 [is_archive] => [is_date] => [is_year] => [is_month] => [is_day] => [is_time] => [is_author] => [is_category] => [is_tag] => [is_tax] => [is_search] => [is_feed] => [is_comment_feed] => [is_trackback] => [is_home] => [is_404] => [is_embed] => [is_paged] => [is_admin] => [is_attachment] => [is_singular] => 1 [is_robots] => [is_posts_page] => [is_post_type_archive] => [query_vars_hash:WP_Query:private] => f218c945855497c7b85b948ea929583f [query_vars_changed:WP_Query:private] => [thumbnails_cached] => [stopwords:WP_Query:private] => [compat_fields:WP_Query:private] => Array ( [0] => query_vars_hash [1] => query_vars_changed ) [compat_methods:WP_Query:private] => Array ( [0] => init_query_flags [1] => parse_tax_query ) )sample page
WP_Query Object ( [query] => Array ( [page] => [pagename] => benelux/sample ) [query_vars] => Array ( [page] => [pagename] => benelux/sample [error] => [m] => [p] => 0 [post_parent] => [subpost] => [subpost_id] => [attachment] => [attachment_id] => 0 [name] => [static] => [page_id] => 0 [second] => [minute] => [hour] => [day] => 0 [monthnum] => 0 [year] => 0 [w] => 0 [category_name] => [tag] => [cat] => [tag_id] => [author] => [author_name] => [feed] => [tb] => [paged] => 0 [meta_key] => [meta_value] => [preview] => [s] => [sentence] => [title] => [fields] => [menu_order] => [embed] => [category__in] => Array ( ) [category__not_in] => Array ( ) [category__and] => Array ( ) [post__in] => Array ( ) [post__not_in] => Array ( ) [post_name__in] => Array ( ) [tag__in] => Array ( ) [tag__not_in] => Array ( ) [tag__and] => Array ( ) [tag_slug__in] => Array ( ) [tag_slug__and] => Array ( ) [post_parent__in] => Array ( ) [post_parent__not_in] => Array ( ) [author__in] => Array ( ) [author__not_in] => Array ( ) ) [tax_query] => [meta_query] => [date_query] => [queried_object] => WP_Post Object ( [ID] => 10781 [post_author] => 1 [post_date] => 2016-04-11 11:59:39 [post_date_gmt] => 2016-04-11 11:59:39 [post_content] => [post_title] => sample [post_excerpt] => [post_status] => publish [comment_status] => closed [ping_status] => closed [post_password] => [post_name] => sample [to_ping] => [pinged] => [post_modified] => 2016-07-07 14:31:02 [post_modified_gmt] => 2016-07-07 12:31:02 [post_content_filtered] => [post_parent] => 11240 [guid] => https://domain.com/?page_id=10781 [menu_order] => 0 [post_type] => page [post_mime_type] => [comment_count] => 0 [filter] => raw ) [queried_object_id] => 10781 [post_count] => 0 [current_post] => -1 [in_the_loop] => [comment_count] => 0 [current_comment] => -1 [found_posts] => 0 [max_num_pages] => 0 [max_num_comment_pages] => 0 [is_single] => [is_preview] => [is_page] => 1 [is_archive] => [is_date] => [is_year] => [is_month] => [is_day] => [is_time] => [is_author] => [is_category] => [is_tag] => [is_tax] => [is_search] => [is_feed] => [is_comment_feed] => [is_trackback] => [is_home] => [is_404] => [is_embed] => [is_paged] => [is_admin] => [is_attachment] => [is_singular] => 1 [is_robots] => [is_posts_page] => [is_post_type_archive] => [query_vars_hash:WP_Query:private] => 1fff3aecd45700c27bc5058ee5cdca24 [query_vars_changed:WP_Query:private] => [thumbnails_cached] => [stopwords:WP_Query:private] => [compat_fields:WP_Query:private] => Array ( [0] => query_vars_hash [1] => query_vars_changed ) [compat_methods:WP_Query:private] => Array ( [0] => init_query_flags [1] => parse_tax_query ) )needed to post it here. Website is live for others.
- This reply was modified 8 years, 6 months ago by Taro.
Forum: Hacks
In reply to: Re: Search result based on menu categoryi did remove add_action(‘init’, ‘tg_home_by_region’); and domain.com/ and wp-login works again.
domain.com/benelux?category_name=benelux
domain.com/benelux?category_name=benelux-news
domain.com/benelux?tag=watch
domain.com/benelux?tag=takeoff
domain.com/benelux?tag=readyThe above are not linking correct. Thy go to the region homepage…
Forum: Hacks
In reply to: Re: Search result based on menu categoryFor Benelux and Worldwide the posts that are displayed are correct. The search works on the region aswel.
The “intro” breadcrumb should redirect to domain.com/ now its redirecting to domain.com/region.
The menu is correct for both regions
The login is not redirecting to the correct page. It just loads the login page again. But login works.
I’m not sure if other things like tags etc work correct.
Forum: Hacks
In reply to: Re: Search result based on menu categoryok im not going to explain what i did but it should be fixed ??
Forum: Hacks
In reply to: Search result based on menu categoryremoving the following did not work…
add_action(‘pre_get_posts’, ‘tg_set_region’);
add_action(‘init’, ‘tg_home_by_region’);
add_filter(‘term_link’, ‘tg_alter_term_links’, 999, 3 );maybe below:
// check for more posts $args['no_found_posts'] = true; // just get a count $args['ignore_sticky_posts'] = true; $args['offset'] = $next_off; $query = new WP_Query( $args ); // get next page post count $ct_next = $query->post_count; $args['offset'] = $prev_off; $query = new WP_Query( $args ); // get prev page post count $ct_prev = 1 < $s_page ? $query->post_count : 0;
Forum: Hacks
In reply to: Search result based on menu categoryok we are back! domain.com/benelux/sample works correct.
The pre_get_postst and $explode[1]; is active again.
List to do:
tags, blog, archives, category etc
pagination css?
more?Forum: Hacks
In reply to: Search result based on menu categoryI found the problem; and im sorry the region search page was not linked as subpage to /benelux/
Forum: Hacks
In reply to: Search result based on menu categoryAny idea why the region no longer appears in the request? This part of your site I never understood, I just trusted it to work, and now it apparently doesn’t ??
Let me try to explain it:
First thing i did is i made 2 pages one i called benelux and the other worldwide. Alle the subpages i have linked to the correct region page.
Also i made a custom region taxonomy called “Location”. Here i can select if a page or post is “benelux” or “worldwide”
see here my currect function.php
Forum: Hacks
In reply to: Search result based on menu categoryThe menu for worldwide was the one from benelux atm
i have put back $region = $explode[1]; to fix this.If you look at the breadcrums; the link “Intro” should be the startpage. This is changed in the function code at the moment. When i remove all the added function code the “intro” link/page is working again.
Forum: Hacks
In reply to: Search result based on menu categoryi think it has to do with “$region = ‘benelux’; //$explode[1];”
Forum: Hacks
In reply to: Search result based on menu category// add region category to main queries add_action('pre_get_posts', 'tg_set_region'); function tg_set_region( $query ) { if ( get_option('page_on_front') == $query->get('page_id')) return; if ( !is_admin() && $query->is_main_query()) { global $region; $explode = explode('/', $_SERVER['REQUEST_URI']); $cat = $query->get('category_name'); $region = 'benelux'; //$explode[1]; if ( '' != $cat ) $cat .= '+' . $region; else $cat = $region; $query->set('category_name', $cat); } }
When i remove the add action here the region will be removed. I tryed all the options but im not getting only benelux.
Region:
Referrer: https://link.com/benelux/sample
Request: /region-search?term=basel&category_name=&submit=SearchForum: Hacks
In reply to: Search result based on menu categorycrap i have to back-up this forum posts…
Forum: Hacks
In reply to: Search result based on menu categorythe hidden field is active again in the searchform.php:
<?php echo "<input type='hidden' name='category_name' value='$region' />"; ?>
I changed the code in function.php.
For the info; the wp-login.php will not redirect to the front/home page after login.
Forum: Hacks
In reply to: Search result based on menu categoryi have put it like this:
<?php global $region; echo "Region: $region<br>\n"; echo "Referrer: {$_SERVER['HTTP_REFERER']}<br>\n"; echo "Request: {$_SERVER['REQUEST_URI']}<br>\n"; ?>
Forum: Hacks
In reply to: Search result based on menu categorythere is a syntax error in that code