New answers tagged

1

Looking at the pre_get_posts hook, the problem becomes apparent, the $Format variable is being pulled out of thin air: function get_all_terms($query) { if(empty($Format)) $Format = 'test 1'; echo $Format; This variable is undefined, you cannot declare a variable in one file then use it in in other places like this. To do that you have to ...


1

Welcome to WPSE. There's probably more than one way to do this, but here's my first thoughts. The first thing you may want to do is to register a custom post type (CPT) for the video content. This way you can have "video library" at the backend (i.e. Dashboard) for managing the video content. If you don't need to add long text content to be shown along the ...


0

Oke, so after days of digging I finally found the answer. The problem was: index.php?pagename=$matches[1]/$matches[2]&city=$matches[3] The 'pagename' parameter had to be set and filled too, with both 'slugs'. The complete code I ended up with: function custom_rewrite_rule() { add_rewrite_rule( '(.*)/(.*)/([a-z-]{4,20})[/]?$', 'index.php?pagename=$...


1

There are a few points to share because I could foresee that the comment will be very long and I post some suggestion here for reference and hopefully could fix it up. 1st point about the rewrite $newrules['/(\d*)$'] = 'index.php?city=$matches[1]'; I guess you expect to use a url like https://example.com/new_york/ to the path so city will take up new_york ...


Top 50 recent answers are included