Tag Info

New answers tagged

0

Obviosuly... I WAS missing something. I uploaded pictures that hade smaller dimensions then specified in the customized image sizes and they wouldn't scale up. Images with 500x500 or higher works fine, but if I upload an image width 200x300 it won't work as expected. This issue is not so well documented in the codex.


1

In the filter, you will need to find the post parent of $post, get the value of the custom field of parent post and then add that value to $post['post_excerpt'] (where the caption is stored): add_filter('attachment_fields_to_save', 'wpse_insert_custom_caption', 10, 2); function insert_custom_default_caption($post, $attachment) { //Check if the $post is ...


1

If you are comfortable with Composer — by all means that's precisely what you should use to manage your WordPress site! I have made a mini site Composer in WordPress on topic in general and your cornerstones will be: johnpbloch/wordpress package for WP core WPackagist for proxying official plugin repo


1

As already said it's a question of the css-styles. Try something like #sidebar li a { display: block; margin: 0; padding: 5px 15px 5px 5px; text-align: left; } The a tag gets the padding, not the li-tag


0

I think that using a lof of CSS files makes it difficult to maintain, mainly when you have one file with the Responsive Design. Also, to have one file with the basics and then another file with different colors isn't good because it makes more requests to the server, when making only one request would be enough. In that case, my solution: Use ...


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 ...


1

You could do this like so: <?php $next_post_link = get_next_post_link( '%link', 'Article Précédent', TRUE ); $previous_post_link = get_previous_post_link( '%link', 'Article Suivant', TRUE ); ?> <?php if ( $next_post_link || $previous_post_link ) : ?> <div class="article_single_prev_next"> <div class="article_prev"> ...


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 ...



Top 50 recent answers are included