Tag Info

Hot answers tagged

5

Yes it is. It might get a bit clearer if you re-format this line $title .= " $sep " . sprintf( __( 'Page %s', '_s' ), max( $paged, $page ) ); to: $title .= " $sep "; $title .= sprintf( __( 'Page %s', '_s' ), max( $paged, $page ) ); The first parameter of sprintf expects a format which is here the return value of the __ function. The second ...


2

You are fetching all the terms of your taxonomy, Use this instead : $terms = wp_get_post_terms(get_the_ID(), 'city-type'); if ( ! empty( $terms ) && ! is_wp_error( $terms ) ){ foreach ( $terms as $term ) { echo '<span>' . $term->name . '</span>'; } } Note : First argument to the function is id of the ...


2

I'm surprised get_current_blog_id() didn't work, since that's probably the best way to approach it. Always try doing a var_dump( $current_blog ) to make sure you're testing for what you need. Edit (19 Aug 2015): Also, triple check that you know which header you're expecting to see and that you're making the change you want in the right header file. ...


2

I assume you mean fetching an external feed with an HTTP authentication. Fetching feeds with HTTP Authentication Note that fetch_rss() uses the MagPie library, that's deprecated in WordPress. Use instead fetch_feed() that uses the SimplePie library. It looks though it doesn't support this kind of url: http://user:pass@example.tld/feed/ like we can ...


2

In a nutshell it's really done with shortcodes but many themes use a visual builder so you don't really need to know the shortcodes. One of the most used visual builder is Visual Composer plugin.


2

Nice sleuthing. Every single person on this SO site has been foiled by something exactly like this at one point or another with the WordPress template hierarchy. You might think of this backwards though. All the steps you found lead you back to the shortcode [pmpro_account] which gets output in the loop-myaccount.php by way of the_content(). That ...


1

What you would do, is have your default single-article.php. This will get called by default because of the WP permalinks and templating system. At the top of your single-article.php do the following before your get_header() call: <?php $language = get_the_terms( get_the_ID(), 'language' ); if ( ! is_wp_error( $language) && $language && ...


1

It is excruciatingly painful to deeply customize WordPress load process. It's not quite clear if your requirements here are performance related or tied to soemthing else. For your question as stated there would be about following approaches (madness ascending): get rid of actual code causing unwanted queries, altogether or via techniques like caching ...


1

Use php dot notation. Try: $my_templates = get_stylesheet_directory() . '/lp/'; $base = array( trailingslashit(get_template_directory()), $my_templates );


1

Before I start, it will be a good idea to check out my answer to the following post What is singular.php? It will give you some more insight As I stated in the linked answer, You can have a fully functional website with just index.php as template to display posts with for all pages What you are doing is fine, and if there are any speed difference, it ...



Only top voted, non community-wiki answers of a minimum length are eligible