Problem with add_rewrite_tag
cat is a reserved query variable used for the ID of a post category. To avoid conflicts with WordPress and/or other plugins and themes I’d recommend you ‘namespace’ your query variables eg eddh_cat instead of cat
cat is a reserved query variable used for the ID of a post category. To avoid conflicts with WordPress and/or other plugins and themes I’d recommend you ‘namespace’ your query variables eg eddh_cat instead of cat
Here a little function which takes care to hide (In admin) Custom Post Types. function remove_from_admin_menu(){ // Check capability (admin) if( current_user_can( ‘edit_dashboard’ )){ //Do nothing } elseif ( current_user_can( ‘moderate_comments’ ) ) { // editor capability remove_menu_page( ‘edit.php?post_type=cpt01’ ); // add here your cpt name remove_menu_page( ‘edit.php?post_type=cpt02’ ); remove_menu_page( ‘edit.php?post_type=cpt03’ ); // for submenu … Read more
Setting a cookie in functions.php and it gets deleted when working on an other function
Child Theme functions.php has no effect
Ah, I see a few places where I went wrong. For one, in the switch statements, when I tried to return answers using echo, I was using parentheses, which work fine in one offs, but apparently cause an error in a function(?). Thanks to the one who edited my first code! I would not have … Read more
wordpress not calling peliegro functions.php?
It turns out that some themes disable functions.php for the backend, in order to prevent a complete lockout. The way they do this, is by simply doing an is_admin() check. However, since all AJAX is ran through admin-ajax.php, this returns true, and the theme functions are not loaded. In this particular case (Genesis Framework (theme) … Read more
Set your posts/pages as “password protected”. In the Publish box when editing/creating a post, change the visibility from public to password protected UPDATE You’ll need to use some rewrite rules to redirect everything to the root URL. The first condition redirects everything to the root URL, the second condition adds exceptions for images, css, javascript … Read more
Some of the functions are in wp-includes/pluggable.php, notably wp_authenticate() though you’ll notice that most of the work is done by filters hooked to authenticate. The names of those you can find in wp-includes/default-filters.php and the function definitions in wp-includes/user.php. But be aware that functions in pluggables.php can be replaced by theme or plugin code in … Read more
To grab the img tag as a variable: get_the_post_thumbnail ( int $post_id = null, string|array $size=”post-thumbnail”, string|array $attr=”” ) or if you want to outright echo it: the_post_thumbnail ( string|array $size=”post-thumbnail”, string|array $attr=”” ) Most things like the post content, excerpt, title etc, are acquired using functions like this so that filters and hooks can … Read more