Andrew Croce
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: How to determine if URL param is a taxonomy query var?$var_is_tax is false in this example, as I noted.
Not sure what you mean by your second question, the “tag” query variable as a built in WordPress query variable. But regardless, the question applies to any taxonomy query variable that might differ from its corresponding taxonomy name. How that query variable is set up is outside the scope of this question.
In any case, I have found a solution, albeit not a pretty one.
foreach( $_GET as $query_var => $value ) { $matching_taxonomies = get_taxonomies( array( 'query_var' => $key ), 'objects' ); if( !empty( $matching_taxonomies ) ) { $taxonomy = reset($matching_taxonomies); // the first item in the array... the only item } }
The get_taxonomies() function returns an array of taxonomies, which is kind of awkward since I’m just looking for one. Not very elegant in my opinion, but it works for my needs. If anyone has a simpler solution I’d be happy to give it a try.
Thanks.
Forum: Fixing WordPress
In reply to: How to determine if URL param is a taxonomy query var?Hi thanks for the reply.
Thats not quite what I’m after. The value of the taxonomy in the URL isn’t relevant here, its the taxonomy itself I am trying to identify.
foreach( $_GET as $query_var => $value ) { // This is false, because "tag" is a query variable, not a taxonomy name $var_is_tax = taxonomy_exists( $query_var ); ... }
Forum: Themes and Templates
In reply to: [Twenty Fourteen] Number of Posts displayedYes, in the admin area go to Settings > Reading and change the setting for “Blog pages show at most” to whatever number you like.
Your second question depends on the theme you are using. Unless those options are built into the theme’s settings, you would have to modify the template files to achieve this–meaning you will need to write some PHP and HTML.
Forum: Themes and Templates
In reply to: [Mountain Creek] child stylesheet not overridingWhere are you seeing this when you say its at the top of your screen? On the front end of the website? or in the admin somewhere?
That code should definitely not be visible anywhere but in the files, so I’m not really sure whats going on. Can you perhaps explain how your theme files are organized? Perhaps you have files in the wrong place, or named incorrectly.
Forum: Themes and Templates
In reply to: [Mountain Creek] child stylesheet not overridingYes you are probably correct, your theme isn’t loading your stylesheet. If you do not already have a file called functions.php in your child theme, create one, and try adding this code:
<?php //Opening PHP tag function mountain_creek_child_add_css() { wp_enqueue_style( 'main_style_overrides', get_template_directory_uri() . '/style.css', array('main_style') ); } add_action( 'wp_enqueue_scripts', 'mountain_creek_child_add_css' ); ?> // Closing PHP tag
This code should inject your stylesheet into the head of your html.
Note: if there already is a functions.php in your child, you will probably not need to add the opening and closing PHP tags.
Forum: Themes and Templates
In reply to: Displaying Custom Taxonomy Archive in Ascending OrderWhile what you have will work, it is not the idea way. Essentially you are creating a second query on top of the main query. In many cases this will not make a noticeable difference, but for more complex queries, and in the interest of doing things correctly, you should modify the main query before it reaches the template.
In your functions.php:
function my_query_modifications( $query ) { // Are we querying a taxonomy archive? if( $query->is_main_query() && $query->is_tax()) { // If so, modify the order variables $query->set( 'orderby', 'date' ); $query->set( 'order', 'ASC' ); } } add_action('pre_get_posts', 'my_query_modifications');
We are hooking into the action prior to running the query, so we can modify it as needed. First we check if its the main query (and not some sub-query we might not want to modify). Then we check if its a taxonomy we’re querying. Then we simply set the query variables we need to change.
Note this will work to change any query variable, not just order.
Forum: Plugins
In reply to: [Breadcrumb Trail] How do I change the style of the breadcrumb display?Look at the readme.md file in the plugin directory, as stated in the installation instructions. Lots of options available.
Forum: Plugins
In reply to: [Social Login] "css_theme_uri" is not reflectedI tried this as well, and similarly it has no effect on the iframe. I wonder if this functionality is restricted to paid Oneall accounts, can anyone confirm this? I haven’t seen any reference to this being the case, but its the only think that makes sense.