How to avoid duplicate Url for the home page

From the comments: What are your settings under Dashboard -> Settings -> Reading. Specifically, what are your Front Page Displays, front page, and posts page settings? And your reply: exactly this is the point, the client has used a Theme called Choice and in the Theme Frontpage Settings there is this page selected :”Welcome to … Read more

Choose template depending on URL

One post cannot (and should not) have two single post URLs. All you can change is the archive view, the list of posts. If /gallery/ and /extra/ are post of the post type page, use a custom page template for those. Update Create two endpoints gallery and extra for the root (EP_ROOT) (another example). The … Read more

How to configure nginx for wordpress

Provided info by you is SO huge… so i can only advice. run nginx – it works? goto step 2 run nginx with php, see info.php with phpinfo() insie? goto step 3. run nginx with php and global host rewrite to this index script. It works ? go to step 4. run nginx with php … Read more

Set active class in a Php foeach

Have no idea what is $link->slug is it a post type property? or taxonomy? Something else? in case of something else you can use a strpos in comparing url? echo'<a href=”https://wordpress.stackexchange.com/questions/73941/. network_site_url() .”/services/’ .$mylink->slug . ‘ class=”. ($mylink->slug) . (stripos($_SERVER[“REQUEST_URI’], $mylink->slug) !== false ? ‘ active ‘:”).'” >’; in case of post use get_post_field global … Read more

How can I sort posts ascending by post title for a specific post type, but on a category archive template?

You can use pre_get_posts to hook in and change the query. The argument passed to pre_get_posts is the query object. It fires for every query, so you need to check some things first. Quick example (not-tested) — change the order on only the video type’s post type archive page. <?php add_action(‘pre_get_posts’, ‘wpse73991_change_order’); function wpse73991_change_order($q) { … Read more