Articles of filters

when use function the_content break

i use the function below to show content under the_content. It works on pages which uses template-test.php. But on other pages the_content stops output. function beschreibung_kriterien( $content ) { if ( is_page_template( ‘template-test.php’ ) ) { $content .= ‘<h2>Test</h2>’; return $content; } } add_filter( ‘the_content’, ‘beschreibung_kriterien’, 5 );

Filter page title (displayed in browser tab) of wp-login

For wp-login.php, the default page title, as displayed in the browser tab, is “Log In”. I need to change this value using a filter in functions.php. Every solution I’ve read addresses the header title but I need to modify the head title.

Remove post type filter added by the plugin in the final query

I am querying the post types based on the custom post type, but when printing the final query it also includes the post_type=’tribe_events’, which is due to plugin using for the events. But I have added the following parameters only in the query: $args = array( ‘post_type’ => ‘mycustomepost’, ‘posts_per_page’=>1 ); How to remove the […]

How to use apply_filters?

So I am using a plugin which loads next posts as the user scrolls down in the single.php file. Inside the main php file of the plugin, there is something along the lines of // By default, don’t query for a specific page of a paged post object. // This argument can come from merging […]

I need to hook and change language of facebook sdk

I need to hook into this function to change language to from en to french facebook sdk. $facebook_sdk_src = apply_filters( ‘bimber_facebook_sdk_src’, ‘//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.5’ ); So I only need to change this url on second, and I need to add or apply some filter. So how can I change this url part //connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.5

Insert Content Before div#main from the functions.php File

I know WordPress has a filter for targeting the content in the functions.php file: add_filter( ‘the_content’) However, is there a filter to insert content BEFORE ? ‘the_content’ filter puts content AFTER div#main. I’m looking for something like: add_filter( ‘before_main’) Does a filter like that exist?

Admin: how to make a custom list filter button send GET queryvars

I’ve setted custom columns for a custom post type, and I want to add a filtering functionality. I need to use custom data, so I can’t take advantage from things like wp_dropdown_categories and the like. My current code: // add select function add_filter_by_macroarea() { global $typenow; $post_type = ‘distributor’; $macroaree = array(‘italy’,’france’,’spain’,’world’); if($typenow == $post_type) […]

change “missing attachment” text functions.php

WordPress core file: wp-includes/post-template.php has this text “Missing Attachment” that i want to change with “-“. The problem is that when WordPress upgrades, the file is changed back to the old “Missing Attachment” text. So, are there any filters I can use in my functions.php to do that?

tiny_mce_before_init: 'exact' => true has no effect

For a custom theme, the editors want to be able to select three different font sizes in the post editor. I thought about using a standard font size plus defining two extra classes: <p class=”bigger”> and <p class=”smaller”> Therefore I define the following formats in tiny_mce_before_init: $style_formats = array( array( ‘title’ => ‘bigger paragraph’, ‘block’ […]

How to allow users to view pending posts of a specific custom post type?

I have a form on the front end that allows users to post a custom post type. The posts enters the database as pending for later moderation, how do I allow users to view these posts on the front end? Currently I get a 404 because it is in pending status, but in this case […]