Tag Info

New answers tagged

1

This code will do the job. add_action('customize_register', 'themename_customize_register'); function themename_customize_register($wp_customize) { $wp_customize->remove_section( 'static_front_page' ); } It will remove Static Front Page option. Details here


1

I looked for a solution too, but it's too complex. I purchased a plugin: http://codecanyon.net/item/swift-security-the-ultimate-wordpress-protection/10143693 before this I used this WP Hide (http://codecanyon.net/item/wordpress-hide-option/228461), but Swift Security much better. I hope it helped.


0

You could develop your own metabox for the page (with custom styling, probably) that allows selection of the template. I don't know that generating screenshots is feasible, but you could definitely have it pull from some sort of associated file (eg: template name is template-name.php, screenshot is template-name.png). With the replacement selection method ...


1

I figured this out. For anyone facing the same issue, I ended up using this code instead: function hi_customization_options( $wp_customize ) { $wp_customize->add_section( 'landing_page_image', array( 'title' => 'Landing Page Image', 'priority' => 35, ) ); $wp_customize->add_setting( ...


0

I was doing something similar the other day and simply could not get attachment_fields_to_save to work no matter what I tried. I ended up using the edit_attachment filter instead along with code like the following: public function action_edit_attachment( $attachment_id ) { # Check to make sure we were sent by the side of the media editor, not by the ...


0

I actually had to give an additional capability to the role I was using. I had to give access to the capability edit_others_php and the file was successfully uploaded.


-3

I just want to add that if you see a 404 page after you add this taxonomy for a post type, then you simply put flush_rewrite_rules(); in the register taxonomy section. For example: register_taxonomy( 'country', array( 'job' ), $args ); flush_rewrite_rules();


3

As said in a comment, you can do this in one query. The principle here is to only display the date heading if the post date's month of the previous post does not match that of the previous post FEW NOTES Before I start, a few notes: Never use query_posts, except if you really need to break everything on a page. It not just reruns the main query and also ...


2

Updated Answer After thinking about the comment from @PieterGoosen below I've added a method of achieving the you goal by using a single query. I benchmarked the methods and the single query is faster, with the multiple query method being about 15% slower. Not a hugh margin, but every little helps, and to be honest the method can probably be refined ...


0

You can use the customize_register action like this: function my_customize_register( $wp_customize ) { /* Just use the $wp_customize object and create a section or use a built-in section. */ $wp_customize->add_section( 'my_section', array( 'title' => 'My Section', 'priority' => 30, ...


3

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 ...



Top 50 recent answers are included