Forum Replies Created
-
AuthorPosts
-
November 16, 2017 at 2:02 am in reply to: Strange behaviour in WooCommerce – remove item from cart -> Server error #213625trashParticipant
I did figure it out!
It's because of this meta tag:
<meta name="referrer" content="origin" />
November 16, 2017 at 1:59 am in reply to: Strange behaviour in WooCommerce – remove item from cart -> Server error #213624trashParticipantI noticed that inside wp_get_referer the $_SERVER['HTTP_REFERER'] is different when I use TwentySeventeen instead of Genesis.
When using TwentySeventeen the $_SERVER['HTTP_REFERER'] returns domain.com/project/cart.
When I use Genesis I get a domain.com as referer.
How can that be? Nobody has an idea on this?
November 15, 2017 at 12:17 pm in reply to: Strange behaviour in WooCommerce – remove item from cart -> Server error #213599trashParticipantHello,
I still have this issue. It's weird, it happens when I use the Genesis Sample Child Theme as well.What I did notice now is that the referer is not set correctly.
When I use TwentySeventeen as a theme and I call the
remove_item
ajax action and I looked atpublic static function update_cart_action() {
inwoocommerce/includes/class-wc-form-handler.php
and did:var_dump(wp_get_referer());
I get something like this:
domain.com/project/cart
When I activate Genesis and remove something from the cart, I do get:
domain.com
Does anybody know why this happens? wp_get_referer() in my case works differently if I use TwentySeventeen in comparison to Genesis.
P.S: The server does tells me this:
[Wed Nov 15 18:56:55 2017] [autoindex:error] [pid 10676] [client ] AH01276: Cannot serve directory /is/htdocs/wp101_TWGAEPLQ0D/www/projekte/: No matching DirectoryIndex (index.html,index.htm,index.shtml,index.php,index.php5,index.wml,index.xml) found, and server-generated directory index forbidden by Options directive
trashParticipantAny idea Victor?
May 12, 2017 at 8:14 am in reply to: Strange behaviour in WooCommerce – remove item from cart -> Server error #206327trashParticipantYep, several times.
trashParticipantYep /location shows all posts that are made with CPT "location"
trashParticipantHey Victor,
so I have a custom post type with several custom post taxonomies:The CPT is registered with:
'has_archive' => 'location',
'rewrite' => array('slug' => 'location','with_front' => false),The Taxonomy is created with:
register_taxonomy( 'locations', 'location', array( 'hierarchical' => true, 'labels' => $labels, 'query_var' => true, 'show_admin_column' => true, 'rewrite' => array( 'slug' => 'location', // This controls the base slug that will display before each term ), ) );
Now I want to create a filter on the CPT's archive page with the contents of the taxonomy. That works, but when I select the option in the drop down and click on the submit button, I get 404 error.
I do not understand what you mean with "I would assign it to a variable and pass it into the loop function. $_GET should be available if you are reading them from a page called location."
When I visit /location?test=123 And place var_dump($_GET['test']); in my loop on archive-location.php I do not see the dump. So my question is basically how I can create a filter with a taxonomy on a custom post type archive page...? I need to access the loop to filter the available entries. My assumption was, that the 404 is thrown because the slug and the rewrite might interfere?
trashParticipantThanks for the advise. I see what it is done there, but in my case it does not solve my issue. So I think I still have to copy the genesis hooks in my own set of functions.
I tried it with replicating their code as follows, but then both genesis_custom_loops are showing the same posts. I do not know why, as $section_one and $section_two are having different category ids:
remove_action('genesis_loop', 'genesis_do_loop'); add_action( 'genesis_loop', 'infinity_team_loop' ); function infinity_team_loop() { global $post; global $wp_query; $section_one = get_post_meta( get_the_ID(), 'kategorien_1', true ); $headline_one = get_post_meta( get_the_ID(), 'headline_1', true ); $args = array( 'posts_per_page' => 4, 'offset' => 0, 'category' => $section_one, 'category_name' => '', 'orderby' => 'date', 'order' => 'DESC', 'include' => '', 'exclude' => '', 'meta_key' => '', 'meta_value' => '', 'post_type' => 'post', 'post_mime_type' => '', 'post_parent' => '', 'author' => '', 'author_name' => '', 'post_status' => 'publish', 'suppress_filters' => true ); $loop = new WP_Query( $args ); // Setup the team entry actions. add_filter( 'post_class' , 'infinity_team_class' ); genesis_custom_loop( $args ); remove_filter( 'post_class' , 'infinity_team_class' ); wp_reset_postdata(); wp_reset_query(); $section_two = get_post_meta( get_the_ID(), 'kategorien_2', true ); $headline_two = get_post_meta( get_the_ID(), 'headline_2', true ); if (!empty($section_two)) { $args2 = array( 'posts_per_page' => 5, 'offset' => 0, 'category' => $section_two, 'category_name' => '', 'orderby' => 'date', 'order' => 'DESC', 'include' => '', 'exclude' => '', 'meta_key' => '', 'meta_value' => '', 'post_type' => 'post', 'post_mime_type' => '', 'post_parent' => '', 'author' => '', 'author_name' => '', 'post_status' => 'publish', 'suppress_filters' => true ); } $loop = new WP_Query( $args2 ); // Setup the team entry actions. add_filter( 'post_class' , 'infinity_team2_class' ); genesis_custom_loop( $args2 ); remove_filter( 'post_class' , 'infinity_team2_class' ); wp_reset_postdata(); wp_reset_query(); }
Do you know why?
trashParticipantYep, that's what I thought as well. Using WP_Query and putting the genesis_action_hooks in the loop as above. How would your solution look like? Same as above?
trashParticipantBasically I have one front page which has 4 parts and is fed through several custom post fields that I have created with ACF. The user in the backend can select 4 different categories for those 4 parts which are displayed on the front page. The query gets the latest posts for each category that has been selected.
I could solve this by creating 4 WP_Query's to select the posts of the 4 selected categories, create a foreach loop and my own HTML structure to get it going. But I was asking myself if I also can create 4 different genesis_custom_loops with the data from the custom fields, but then I have no possibility to target those 4 different loops with hooks, because the structure of the posts should be different.
So, when I use a hook like genesis_entry_content, I can only ask if (is_front_page()), but not something like is_front_page && custom query number 4.
So I came up with using the genesis hooks, but not genesis_custom_loop and there I do not have the possibility to get the index of my custom $myposts variable in order to determine which HTML structure I want to show.
Is this explained clearly or confusing? 🙂
trashParticipantHey Victor,
it says -> NULL. So somehow the variable is not known tot the hook.$myposts NULL
?’Called from <ROOT>project/wp-content/themes/customtheme/front-page.php:49 [custom_genesis_entry_header()]
<ROOT>project/wp-includes/class-wp-hook.php:298 [call_user_func_array()]
<ROOT>project/wp-includes/class-wp-hook.php:323 [WP_Hook->apply_filters()]
<ROOT>project/wp-includes/plugin.php:453 [WP_Hook->do_action()]
<ROOT>project/wp-content/themes/customtheme/functions.php:1498 [do_action()]
<ROOT>project/wp-includes/class-wp-hook.php:298 [call_user_func_array()]
<ROOT>project/wp-includes/class-wp-hook.php:323 [WP_Hook->apply_filters()]
<ROOT>project/wp-includes/plugin.php:453 [WP_Hook->do_action()]
<ROOT>project/wp-content/themes/customtheme/front-page.php:61 [do_action()]
<ROOT>project/wp-includes/template-loader.php:74
<ROOT>project/wp-blog-header.php:19
<ROOT>project/index.php:17May 27, 2016 at 12:30 am in reply to: Genesis Framework – add class to genesis_attr( 'entry' ) #186364trashParticipantHey Victor,
thanks for the reply. It helps to a certain point, but my issue is that I have a custom query, and this query targets 2 specific posts, which come back. Currently I have no idea how to target only these two posts which come from my query.The code currently is this:
$cat_teaser_1_id = get_post_meta($home_id, 'frontpage_cat_teaser_1', true); $cat_teaser_2_id = get_post_meta($home_id, 'frontpage_cat_teaser_2', true); $post_query_1 = new WP_Query(array( 'post_type' => 'post', 'posts_per_page' => 1, category__in => $cat_teaser_1_id, 'orderby' => 'date', 'order' => 'desc' )); //genesis_custom_loop ($args); if ( $post_query_1->have_posts() ) : do_action( 'genesis_before_while' ); while ( $post_query_1->have_posts() ) : $post_query_1->the_post(); $title = get_the_title() ? get_the_title() : __( '(no title)', 'genesis' ); do_action( 'genesis_before_entry' ); printf( '<article %s>', genesis_attr( 'entry' ) );
And there I use the genesis_attr('entry') hook, but this article should have another class than other articles. So I need to add a class to his filter here.
Any idea how to fix this? Can I merge genesis_attr('entry') with another array/string?
Thanks!trashParticipantI figured it out - I checked the function and saw this:
if ( ! is_singular() && genesis_get_option( 'content_archive_thumbnail' ) ) {
The option was not set.
November 19, 2015 at 12:27 pm in reply to: Genesis Custom Loop is unaffected from functions.php? #171550trashParticipantcarasmo,
thanks - sometimes its better to take a break after hours and rethink. 😉Now I removed the page, added a link to the specific category in the menu and changed my If clause to:
if ( is_home() || ( is_archive() && is_category('press') ) ) {
Thats it - no need for me to add an own template for this and the hooks from the functions.php work.
Thanks!
November 10, 2015 at 10:16 am in reply to: Page Template front-page.php – Footer Widgets are gone #170680trashParticipantPlease ignore. There was an error with the content, that is displayed on the page.
trashParticipantDoes anybody have an idea? This issue is very weird for me...
Would be glad if somebody knows something... Thanks!
trashParticipantOn the page the posts are currently listed in descending order, but this only works fine, because all of the posts are set up as "sticky posts". If I remove the status of being sticky from the first post, it completely vanishes from the page.
trashParticipantSure, sorry to not mention the page.
The website can be found here:
http://www.fraeulein-k-sagt-ja.deThanks!
trashParticipantHey Brad,
thanks for the hint. I just did this:global $query_args;
$args = array(
'post_type' =>'post',
'posts_per_page' => '1',
'orderby' => 'date',
'post_status' => 'publish',
'order' => 'DESC',
);genesis_custom_loop( wp_parse_args($query_args, $args) );
But I do not want to show an excerpt here, which is visible for all other articles, and need to add additional classes to the <article %s> Tag. How can I add those here? Do you have a hint?
Can I check if the filter is running in the custom loop, something like "if (is_genesis_custom_loop) {"?
-
AuthorPosts