Custom download page

Finally I solve the problem. Here the code bellow for download button. Put this code into your post loop it will show a download button. <form action=”<?php echo esc_url( home_url( ‘/your_redirected_page_slug’ ) ); ?>” method=”GET” id=”form1″> <?php global $post; //$post_slug=$post->post_name; ?> <input id=”myButton” type=”submit” name=”a” value=”Download” class=”single-download-button” /> <input type=”hidden” name=”appk” id=”mkval” value=”<?php echo get_the_ID(); … Read more

Hide disclaimer from summary excerpts

You could do something like this: /* Add disclaimer to top of POSTS that contain affiliate tag */ function tt_filter_the_content( $content ) { if (has_tag(‘affiliate’) && is_single()) $custom_content=”<hr><p><em>Disclosure: This post contains affiliate links and we may receive a referral fee (at no extra cost to you) if you sign up or purchase products or services … Read more

Redirect logged user depending on user role if he tries to access home page?

Try something like this. Also read about wp_redirect() too. function redirect_by_role(){ if (is_user_logged_in()) { $user = wp_get_current_user(); if (is_home()) { if ( in_array( ‘author’, (array) $user->roles ) ) { $redirect_url=””; wp_redirect($redirect_url, 301); exit; } elseif( in_array( ‘**another_role_here**’, (array) $user->roles ) ) { $redirect_url=””; wp_redirect($redirect_url, 301); exit; } } } else { // Do what you … Read more

I need to ‘wp_dequeue_script’ and ‘styles’ and ADD a bunch of other css and js

Using wp_enqueue_scripts You should use a proper hook to enqueue/dequeue your scripts, to ensure that it works flawlessly. A proper plugin/theme uses wp_enqueue_scripts to do this, so you should do the same. Wrap your code inside a function, and bind it to this action hook. Also, remember to set the priority to something that makes … Read more