Tag Info

New answers tagged

1

Short version — there isn't one. WordPress doesn't handle dependencies logic in any form. If library itself doesn't include any mechanism for it (which is exceedingly rare) — there isn't anything you can do. At best you can (and should) check if expected version of dependency is loaded (if it exposes version in some form or at least by location it's loaded ...


0

Till now, I think that Fulvio's answer's the best one. I'm using that filter even on a multisite setup, with just one line: add_filter('locale', 'set_admin_locale'); function set_admin_locale($locale) { return 'en_US'; } Basically sometimes, and in this case, I use multisite for multi-language sites instead of plugins. Also, I have 1 single theme for ...


1

Yep. You can add a meta_query parameter to methods that query posts, such as WP_Query. This one below gets a custom post type between two dates (which are custom fields created by 'advanced custom fields' plugin) and sorts on one of these dates: $args = array( 'post_type' => 'event', 'posts_per_page' => '-1', 'post_status' => array( ...


0

Depending on your home page, you either can set up a template file home.php (archive) or front-page.php (static page). In the according file, you can do whatever you want. Run additional queries, load content from whatever source etc. If this is not what you want, then you can have a look at the template_include filter hook. If you want/need to do more than ...


1

Got it, after making a Custom Shortcode (this can be found on standard WP docs), then by direct calling one of JW player's function, from the Template File, like: generate_playlist( '1234' ); It will then return a complete Array of the JW Playlist Object, so we can parse it out.


0

After some research I came to conclusion that this splash screen will destroy the website SEO and the usability, so I have decided not to add this kind of page.


0

You need to add the conditional tag after the function which generates the entry meta. As you haven't pasted the code from the correct file which generates it, its impossible to provide the exact solution which includes the conditional tag in the correct position in the code. You would add this conditional immediately after the function name: if ( ...


0

It sounds like you need to run a foreach on a value inside the array. E.g. $checkboxes['value'] as $checkbox.. If you do: print_r('$checkboxes') you'll get an idea of the values you are trying to target. You might even have to do something like $checkboxes['something']['something_else'] depending on how many levels the array has. Hope it helps, do a ...


2

This seems to work, modifying the display_css_output() in this way: function display_css_output() { $html = get_transient( 'my_custom_styles' ); if ( empty( $html ) ) { $html = $this->generate_css_output(); global $wp_customize; if ( ! isset( $wp_customize ) ) { set_transient( 'my_custom_styles', $html, ...


0

Ok, so I rewrote the gallery shortcode function by copying the original and removing/adding/changing what I needed, and now I share it with you. The major things I added/changed are: One single UL/LI list per gallery instead of a DL for each damned item.. Removed 'itemtag' attr, since there's no point in using another tag for items inside an UL 'icontag' ...


1

You can use the the following attributes for the gallery shortcode: [gallery itemtag="ul" icontag="li" captiontag="li"] The problem with this is that the gallery shortcode wraps the image and the caption in different elements(thats why the default solution is using dl-dt-dd), so this will generate one li element for the image, and one for the caption. You ...


0

1) You can use the template search.php and searchform.php as your starting points. Creating a Search Page Codex 2) As far as the custom query goes, you can use pre_get_posts hook to test if you're on a search page, then you get $_GET your values, edit your query accordingly. Action Reference - pre_get_posts There are tons of tutorials online and questions ...


0

Given that the markup of your menu does not seems to generating all of the classes I'd expect to see, I'll guess at the problem. Your theme is using a custom Walker Or something-- theme or plugin-- has added a filter to (probably) wp_nav_menu_css. Though there are other filters that could be used. To fix it, or try to, make sure your theme does not ...


0

UPDATE! OK!!! Woooohooo! Found out what it was.. I should have been calling if have posts before the call for $tax->name; Here is my final, and working code! :) <?php /**********************************************/ // CUSTOM WINE MENU SHORTCODE /**********************************************/ add_shortcode( 'wine_list_per_cat', 'wine_list_per_cat' ); ...


2

You don't need a plugin, if your images names really match with product SKUs and you use media uploader to upload the file, you can use a single function hooked in add_attachment and you are done. Once it require some work, I'd avoid to upload all the hundreds of images in one "session", probably you can upload sets of 25/50 images per time with no ...


1

Looking at your comment, photos and videos aren't custom post types but actually categories. I'm changing my answer to reflect your comment. You can use WP_Query to exclude specific categories in your loop. You can achieve that with $query = new WP_Query( 'cat=-1,-2,-3' ); This will exclude categories with ID's 1, 2 and 3, and will only show categories ...


1

Based on your comment to your question, you might take a look at http://www.wpallimport.com they have a woocommerce addon that works pretty well and includes the product image importer. With a custom CSV i'm sure you could wrangle it to import all in one import for you (including the media manager bit). Now if you are looking to attach existing uploaded ...


1

1) create one template page on your page-templates dir in landingpage.php with this code page-templates/landingpage.php <?php /** * Template Name: Landing page */ ?> <div id="main-content" class="main-content"> <div id="primary" class="content-area"> <div id="content" class="site-content" role="main"> ...


0

Something like this should work but you haven't stated where you want to display the CPT pages for games. function display_games_archive( $query ) { if ( !is_admin() || $query->is_main_query() && is_post_type_archive( 'portcat' ) ) { $query->set( 'category__in', 'games' ); return; } } add_action( 'pre_get_posts', ...


0

Both the "Iconic One Pro" theme and the "Paid Memberships Pro" plugin appear to be commercial products and the question deeply depends on third party products, either of which should make this question off-topic. However, I think it can be generalized to a couple of options: A filter on pre_get_posts add_action( 'pre_get_posts', function($qry) { ...


1

What about using the UNION? Just an example: (SELECT * FROM $wpdb->posts (with JOIN and WHERE as needed)) UNION (SELECT * FROM $wpdb->posts (with WHERE to select pages)) GROUP BY/ORDER BY The select(s) must be in parenthesis to use an order by for the whole union result. As a second option, you can use a plugin to enable the categories and ...


0

*Moved comment to answer as suggested by @kaiser * Original comment accepted as answer If you are using the default wp template hierarchy (which it looks like you are) you won't need any special WP query, WordPress will just know. So take a standard loop. Make a backup of that template, then add a normal WP look and see how you get on. It should ...


0

No, you cannot include PHP files in a theme the way you indicated. To see why, all we have to do is exercise some common sense and basic critical thinking: You would be doing a remote request to a remote server include cannot do this If by some miracle it worked, you would have a major security exploit as I could then do something like this: include( ...


1

It may be time to learn how to use Child Themes. Takes less than 15 minutes to learn, saves huge amounts of time. It could be as simple as creating a style.css and giving it the proper the title info at the top of the file. See https://codex.wordpress.org/Child_Themes#How_to_Create_a_Child_Theme Using a child theme is like laying magic tissue paper over ...


2

In short: make sure that the Jetpack plugin is installed and enabled, and also that the Jetpack Lite plugin is not enabled. I found out that Edit CSS is provided not by WordPress itself but by the plugin Jetpack. Jetpack was still installed; I had a Jetpack menu right below Dashboard. But when I opened it, I saw only two items, “WordPress.com Stats” and ...


1

While I am sure that this is theoritically possible, I am going to say "No, not really". If you look at the source, you can see that those brackets are hard-coded into a very complicated regex. I see no filters that will let you change that. The only reasonable way to approach this that I can think of would be: To remove the default shortcode system ...



Top 50 recent answers are included