Redirect based on $_GET parameters
Redirect based on $_GET parameters
Redirect based on $_GET parameters
I found where problem was – i can’t set other year. All i needed to do is to rename year parameter to something else – for example my_year.
I found a realy great solition here. !! It is a function that kindof ‘adds’ ‘orderby’ => ‘rand’ as a parameter. What it does it that when someone uses that parameter, the function will query the database using regular MySQL, where random is always possible 🙂 The function: // put this in your functions.php add_filter(‘pre_user_query’, … Read more
To search for posts based on date, you can set up a quick instance of WP_Query. The best place to look is the official documentation, and in particular the section on the date parameters. A basic search for posts in a particular month will look a little like this: <?php $the_query = new WP_Query( array( … Read more
I think the add_rewrite_rule is the correct route to go and I think what you have is correct also barring the Regex. Try substituting what you have currently for this => ^my-page\/([0-9]+)\/?. Full code below: function setup_filter_rewrites(){ add_rewrite_rule(‘^my-page\/([0-9]+)\/?’, ‘index.php?pagename=my-page&my_var=$matches[1]’, ‘top’); } add_action( ‘init’, ‘setup_filter_rewrites’ );
If you look at the documentation for add_action, you see that it accepts 4 parameters. The first 2 are required for adding any actions. If you want to change the priority of your action, you use the third parameter. If you want to change the number of arguments the function accepts, you use the fourth … Read more
If you would show pdf in content dynamically, which page would you like to show page, post or wherever. You have to echo your shortcode in template file. For example, you have to print like below <?php echo do_shortcode(“[shortcode pdf=”. $_REQUEST[“pdf_id’] .”); ?> http://yourwebsite.com/post-title/?pdf_id=20 //your url would be like that
Use wp_get_current_user to get the current user (if any) then check or update the display name – update_user_meta or wp_update_user. When you have a user, you’ll probably want to set a flag on the user’s meta for after they have filled out their name, or prompt otherwise. How/where all this would go is really a … Read more
User Affiliate Token Generator?
Why get_terms() behaves strangely when being called in admin (for use in meta box)?