Tag Info

Hot answers tagged

2

There's no way to set this text directly. But, the "Empty Trash" text is run through the translation API before display. You can hijack this translation to replace the text with your own string. get_current_screen() is used to check the post_type of the current admin screen, so you can make sure you're only affecting your "task" type's screens. add_filter( ...


2

I think that the function you need is wp_trim_excerpt. With this function you can generate a excerpt from any text: $text = "Some context"; $excerpt = wp_trim_excerpt( $text ); It is important to note that wp_trim_excerpt use the excerpt length set by WordPress, that is 55 words by default, and make use of excerpt_lenght filter, so it will work with any ...


2

I don't know if it is a typo, but your custom post type name is incorrect, it cannot have spaces, and also you should just use underscores to separate names in custom post type names register_post_type('blog posts', $args ); Is it just blog or blog_posts In your query in your widget, you are querying the custom post type blog, which does not match your ...


1

get_post_custom isn't a great function if you're trying to get values that are serialized, you have to unserialize them yourself. A better function is get_post_meta: $options = get_post_meta( $post->ID, 'photo-artist_tfuse_post_options', true ); echo $options['photo-artist_seo_description'];


1

In this code: if ( $currentCPT = 'rsg_download' ) { you're assigning the value 'rsg_download' to $currentCPT. When you do an assignment inside an if(), the if() only sees the value you assigned. Since a non-empty string is always true, the body of the if() always executes. To test the value instead, you need to use == or even better === (see ...


1

My solution to this problem when extending the Walker_Nav_Menu was to skip check if current_page_parent when C.P.T. I identified C.P.Ts following this stackexchange post. This does not entirely solve the problem as I am using current_page_item for C.P.T parent menu items, but it does achieve the desired outcome. Here is my class. class My_Menu extends ...


1

"Page not found" means it is not a template problem, rather permalink issue. Try setting your permalink to default and than visit the page!


1

First, your filter should return, not echo anything. The content will appear in the wrong place if you echo directly within the function. The original contents of the_content are passed to the filter function as an argument- function fds_the_content( $content ) { // <--- original value of the_content // append original $content $new_content = ...


1

Your problem is your naming convention. Look at the Template Hierarchy. The archive- prefix is reserved for date and custom post type archive pages. You are using this as prefix to a page template This is not only confusing to humans, but to Wordpress as well. For page templates you should be using the page- prefix. Just a note, as from version 3.4 you ...


1

I have managed to resolve this by adding in a custom rewrite into the functions file: // Add custom rewrite rules to handle things like years in custom post archives function add_rewrite_rules($aRules) { $aNewRules = array( 'news/([0-9]{4})/([0-9]{2})/page/?([0-9]{1,})/?$' => ...


1

I have done custom post type with multiple content editors ready to translate, I have used This Metabox Plugin to add the meta boxes, this plugin allows you to create multiple meta boxes according to the theme requirements, to achieve your requirements, 1st install this plugin Here is the link Then add code as follows in your functions.php or separate file ...


1

Have you tried add_theme_support( 'title-tag' ); And remove the title tag from your theme, and call the wp_head() at proper place.And let wp handle the title tag for you.


1

Got help on Facebook and just needed to change this: <option value="<?php echo $term->name; ?>" <?php if($_POST['mealtype'] == $term->name) { echo 'selected'; } ?>><?php echo $term->name; ?></option> to this: <option value="<?php echo $term->slug; ?>" <?php if($_POST['mealtype'] == $term->slug) { ...



Only top voted, non community-wiki answers of a minimum length are eligible