Tag Info

New answers tagged

1

I wonder if you want to modify the HTML of the inserted image, with the image_send_to_editor or get_image_tag filters? If that's the case, then here's one example: /** * Add the data-ext-link-title and data-ext-link-url attributes to inserted images. */ add_filter( 'image_send_to_editor', function( $html, $id, $caption, $title, $align, $url, ...


0

Unfortunately, there's no hook available to change it. You can see it in wp-admin/edit-form-avanced.php: <label class="screen-reader-text" id="title-prompt-text" for="title"><?php echo $title_placeholder; ?></label> <input type="text" name="post_title" size="30" value="<?php echo esc_attr( htmlspecialchars( $post->post_title ) ); ...


0

You need to find the right $menu_slug. The following code worked for me: add_action( 'admin_init', 'remove_menus' ); function remove_menus(){ remove_menu_page( 'wpcf7' ); }


0

In Admin Panel go to Settings -> Permalinks -> at the lower left click on save changes to refresh all permalinks including your custom post type.


0

I have deleted the nav.php file from my header.php, and added back the old menu code that comes with Wordpress. I did some hooking into my style.css file to adjust the styles for the desired design and I only used the #menu-navmenu that I created in WordPress to float right my menu bar. ul#menu-navmenu{float: right;} So before I had this ul#menu {float: ...


0

In your PHP file, set $thisPage before you include('nav.php');. Then, the variable $thisPage will be passed to nav.php and processed in its if statement. This is really bad practice though, and a better way of doing it would be by creating your menu in WordPress itself and hooking it into your template. WordPress documents how to do this well.


0

You would need to add your form to each post, adding in a hidden input with the post id each time. Then, when the nonce validates, be sure to read the passed in post id and use that with update_post_meta. For example if ( isset( ... ) ) { $target_post_id = ( isset($_POST['target_post_id']) )? (int)$_POST['target_post_id'] : 0; if ( $target_post_id ...


0

I actually found this: http://stackoverflow.com/questions/25894288/wordpress-remove-attachment-fields I actually just added the following in my CSS file to basically remove the links at all times: .media-sidebar .details .edit-attachment { display: none; } .media-sidebar .details .delete-attachment { display: none; } To actually show this within ...


2

media_row_actions only filters the links in the Media Library (/wp-admin/upload.php?mode=list) And $wp_query_obj really should be $actions, since that's whats being filtered. What's in the object is an array of action keys and corresponding action links: ( [edit] => <a ...


0

What I would do is remove all that code you have in nav.php displaying the menu, create the menu inside the Wordpress backend, then you'll be able to use .current-menu-item in your css. Then all you need to call the menu will be wp_nav_menu(); Here is the documentation for that function: http://codex.wordpress.org/Function_Reference/wp_nav_menu


2

That link is hard-coded in /wp-includes/media-template.php ~ln 526. Since it can't be removed via apply_filters, you could probably use a small js script like $('a.delete-attachment').remove(); to remove the link.


0

If your theme is using wp_nav_menu() you will have the class current-menu-item added to the relevant <li> element for you. Does this help?


0

As said, you should enqueue your style sheets like this in your functions.php in your theme: function adds_to_the_head() { // Our own unique function called adds_to_the_head wp_register_style( 'custom-style-css', get_stylesheet_directory_uri() . '/css/styles.css','','', 'screen' ); // Register style.css wp_enqueue_style( 'custom-style-css' ); // Enqueue ...


0

Try like this <script src="<?php echo get_template_directory_uri(); ?>/js/jquery.min.js"></script> But it is a good practice to en queue your script in function.php Function Reference/wp enqueue script


0

Working code for adding widget to wp dashboard with information from custom DB: /** * Add application widget to the dashboard. */ function addApplicationWidget() { wp_add_dashboard_widget( 'submitted_applications', 'Submitted Applications', 'showApplicants' ); } add_action( ...


0

It was solved by a coworker. function removebreaks($content) { $content = str_replace('<br>', '', $content); $content = str_replace('<br/>', '', $content); $content = str_replace('<br />', '', $content); $content = str_replace('<BR>', '', $content); $content = str_replace('<BR/>', '', $content); ...


0

Put the files into their own subdirectory in your site and then in your .htaccess (or whatever similar equivalent your server stack uses) tell the server (and thus WordPress) not to rewrite the URLs for that subdirectory. This tells the server and WordPress not to interpret requests for that subdirectory as WordPress "requests".


0

'p' => $id why you this? and if you create show all pages on your testimonial or slider show whatever is_page(); use condition on footer, header, index and YOUR-TEMPLATES


0

You should look into Bedrock: roots.io/wordpress-stack/ Sounds like it'd be a good starting point for you. roots.io is, IMO, as good as it gets for theme development. I've used it for some time now and at the point where I know Bedrock would be a far better workflow - is a little daunting though so love to know how you get on. In terms of multisite ...


0

Admittedly a clever solution, and one that works fine within the scope of your original question. For future readers with similar use cases' reference though I would suggest they also consider creating a multisite (network) install. When used purely for sub domain sites (ie no domain mapping) it's not greatly more difficult to create and manage than a ...


1

The WordPress way of doing it would be to simply create your pages within the WordPress dashboard and create a custom page template to use for these landing pages. However if you don't want to use WordPress (for whatever reason) the safest way would be to place the landing page in it's own directory so you would have ...


0

You could do this, particularly if it was in a sub folder, but I'm really not sure why you would not just integrate it within WP. There is a real risk of clashing with pages that are created within WP and its really not a good idea.


1

Hooks are going to be your best friend here. You can filter post content by using the the_content filter for example: add_filter('the_content', 'wse_174099_append_to_content'); function wse_174099_append_to_content( $content ) { //get your data $custom_items = get_option( 'option_name' ); $content .= wpautop( $custom_items ); //always ...


0

This is how I solved this issue :: function get_client_ip_env() { $ipaddress = ''; if (getenv('HTTP_CLIENT_IP')) $ipaddress = getenv('HTTP_CLIENT_IP'); else if(getenv('HTTP_X_FORWARDED_FOR')) $ipaddress = getenv('HTTP_X_FORWARDED_FOR'); else if(getenv('HTTP_X_FORWARDED')) $ipaddress ...


0

wp-config.php if ( is_alt_domain( $_SERVER['SERVER_NAME'] ) ) { $domain = str_replace( 'www.', '', $_SERVER['SERVER_NAME'] ); define( 'WP_SITEURL', 'http://www.' . $domain ); define( 'WP_HOME', 'http://www.' . $domain ); } else if (is_sub_domain( $_SERVER['HTTP_HOST'] ) ) { $domain = "{$_SERVER['HTTP_HOST']}"; define( 'WP_SITEURL', ...


0

The best way to achieve content separation between sites is to separate their DBs. As a rule of thumb it is easier to aggregate content the separate it, search, RSS feeds, social sharing, SEO might need to behave differently on different subdomain, and there is no way the kids will agree to the design imposed by the "old guys". The easiest solution is to ...


1

It seems file_get_contents() isn't active in your server. Instead, use the wp_remote_get(). Note wp_remote_get() is among the family of WordPress HTTP API specifically used for sending GET requests. The advantage of wp_remote_get() over file_get_contents() and other PHP stream/transport function is - The WordPress HTTP API was created to standardize a ...


0

First, you should remove (!) and replace redmenu_widget with redmenuWidget. Because (_) not using in widget slugs


0

I think you can make this much easier than you are. Just create a my-projects page and forget about the custom rewrite. Why? Because a user will only need to see their own projects. No need for a just rewrite because you can get the current user any time. Embed the project rendering into a shortcode and just pop it into whatever page you want. ...


1

This line of code is incorrect <?php if ( !function_exists('redmenu_widget') || !dynamic_sidebar('redmenu_widget') ) : ?> More to the point, your negative operator (!) is wrong here That line of code simply translates to If the function redmenu_widget does not exist OR if the sidebar redmenu_widget does not exists, do something You should ...


1

Is there some reason you need subdomains over "subdirectories" (I put that in quotes because it won't actually be a real subdir... read on)? This would be much easier if you wanted to go with family.com/me, family.com/her, family.com/project1, etc... Going this route, you could create page templates that have custom loops in them using WP_Query and assign ...


1

Values are saved, but then you have to select the correct option when you print the select. Is the same when you print the input field and you add value="<?php echo esc_attr( $title ); ?>". You can try to change the code between <select> and </select> with this <option value="300x250" <?php echo "300x250" == $widgetads ? ...


1

You can do it with native WordPress codex calls like this ( source http://badlywired.com/technical-stuff/2014/11/10/code-to-delete-all-images-from-wordpress-or-nearly-all/ ) <?php /* create this code in a file in the main wordpress directory e.g. delmedia.php and access it via mydomain.com/delmedia.php */ // Include the wp-load'er ...


1

Use a multisite. There are no good reasons not to do that. For the groups I would use two custom tables: A group table for the description, maybe an image path/ID an a group ID. You could also use a custom post type on the main site for that, but it is easier to optimize the queries for a custom table. A group_users table to associate user IDs with group ...


1

It seems that you are modifying directly the twentyfifteen_get_color_schemes() function on parent theme or redeclaring it on your child theme. You should avoid both cases. In the original code from twenty fifteen can see this: apply_filters( 'twentyfifteen_color_schemes', array(.....) ); That means that you can create a filter to add extra color schemes ...



Top 50 recent answers are included