What action/filter can be used for modifying the page to be rendered?
What action/filter can be used for modifying the page to be rendered?
What action/filter can be used for modifying the page to be rendered?
It was an presentation issue as the content was injected by another plugin and it was an HTML comment “” and this Text will not be shown by an echo or even an print_r() or var_dump()
In your code, I have found 2 issues: 1) In your ajax function ajax_filter_get_posts(), you have missed tax_query in your arg. Your ajax function ajax_filter_get_posts() should be as below: function ajax_filter_get_posts( $taxonomy ) { // Verify nonce if( !isset( $_POST[‘afp_nonce’] ) || !wp_verify_nonce( $_POST[‘afp_nonce’], ‘afp_nonce’ ) ) die(‘Permission denied’); $taxonomy = $_POST[‘taxonomy’]; // WP Query … Read more
So, I found the decision: add_action( ‘the_post’, ‘campaign_remove_nextpage’, 99); function campaign_remove_nextpage ( $post ) { if (($_GET[‘utm_campaign’]== ‘Facebook’ || $_GET[‘utm_campaign’]== ‘Twitter’) && (false !== strpos( $post->post_content, ‘<!–nextpage–>’ )) ) { } else { $totalArticlesPages = substr_count($post->post_content, ‘<!–nextpage–>’); // Google: not paginated // Direct: not paginated // Camp: paginated // Reset the global $pages: $GLOBALS[‘pages’] = … Read more
After a lot of fiddling I managed to get the functionality working. First I add custom dropdown boxes for ‘Regional’ and ‘International’ using wp’s action restrict_manage_posts. Then I set up a custom function that will be added to wp’s filter parse_query. In that function: // type is the name of the select field if($_GET[‘type’] == … Read more
Change add_filter based on Ajax
Try doing something like wp_link_pages( array(‘before’=>'<button>’, ‘after’=>'</button>’) ); It should work!
add_action( ‘woocommerce_view_order’, ‘before_woocommerce_order_details’, 5 ); function before_woocommerce_order_details($order_id){ $order = new WC_Order($order_id); echo “Order Status : “.$order->get_status(); }
If you take a look at the source code of get_the_excerpt you see that there actually two arguments passed to the filter: the excerpt text and the post object. Your are only passing the text, while you need the post object to know the permalink. So you should change these lines: add_filter(‘get_the_excerpt’, ‘my_custom_wp_trim_excerpt’, 99, 1); … Read more
you can filter widget titles by adding below filter : add_filter (‘widget_title’, ‘custom_title’); function custom_title($oldtitle) { //manipulate $title as per your need $title = explode(” “, $oldtitle,2); $titleNew = “<span>”.$title[0].”</span>.”$title[1]; return $titleNew; }