Tag Info

New answers tagged

0

You can configure that in admin panel. Just go »Dashboard > Settings > Permalink« settings.


0

get_query_var() only works with the Core WP_Query object: Retrieve public query variable in the WP_Query class of the global $wp_query object. https://codex.wordpress.org/Function_Reference/get_query_var Your mistake is a simple PHP one: The key is foo, not bar. $foo = $_GET['foo']; echo $foo; But please do not echo user supplied data to the ...


1

When adding an external link you need to include HTTP:// or HTTPS:// at the start of the URL to link to an external domain. Otherwise the link will be added onto the current domain.


0

To grab the img tag as a variable: get_the_post_thumbnail ( int $post_id = null, string|array $size = 'post-thumbnail', string|array $attr = '' ) or if you want to outright echo it: the_post_thumbnail ( string|array $size = 'post-thumbnail', string|array $attr = '' ) Most things like the post content, excerpt, title etc, are acquired using functions ...


0

You need to create a new permalink and after to set some rewrite rules. The function add_permastruct is a good start. You can find a good example here: http://shibashake.com/wordpress-theme/wordpress-permalink-add That's a media library example, but you can use the same functionality for your language module.


1

Exist some WordPress function that retrieve the list of links (in my specific case only one) that are into a post? Check out the core wp_extract_urls() function: $urls = wp_extract_urls( $content ); that will extract urls from any given content. Example $content = 'Two test sites: <a href="http://foo.tld">Foo.tld</a> and ...


1

The simplest and quickest solution would be to use the add_rewrite_endpoint function. <?php add_rewrite_endpoint( $name, $places ); ?> So in your case it would be something like this: add_rewrite_endpoint( 'user', EP_PERMALINK | EP_PAGES ); An user URL would look like this: http://www.example.com/my-page/user/john To access the variable: ...



Top 50 recent answers are included