Tag Info

New answers tagged

0

Yes you can do that. But it will create link like yoursite.com/wp-content/date/month/file.zip You can even do this by plugin Download manager : https://wordpress.org/plugins/download-manager/ It will be easy to use and maintain


0

To eliminate the active "hover" cursor: Theme Options > Drop down menu > Make parent menu items clickable : disable


0

You can upload the files to the media library. Then copy the links within an entry or wherever you prefer. Clicking on the link, the user can download it.


0

With the help of Marcin Pietrzak, I got the answer // "select * from wp_options where option_name = 'wpcf-fields'"; $custom_fields = ( get_post_custom($post_id)); $querystr = "select * from wp_options where option_name = 'wpcf-fields'"; $pageposts = $wpdb->get_results($querystr, OBJECT); if(isset($pageposts) and isset($pageposts[0])): $value = ...


0

lunacodes Please change Permalink in wordpress > Settings > Permalink Settings > SELECTED Post name.


-2

Wordpress themes such as MH News does this by default for all archive pages. Check this quotes website for reference


0

https://codex.wordpress.org/Customizing_the_Registration_Form https://codex.wordpress.org/Function_Reference/wp_update_user Instead of update_user_meta function in user_register hook use wp_update_user Following is the working example: //1. Add a new form element... add_action( 'register_form', 'myplugin_register_form' ); function ...


-1

<?php global $wp_roles; ?> <select name="role"> <?php foreach ( $wp_roles->roles as $key=>$value ): ?> <option value="<?php echo $key; ?>"><?php echo $value['name']; ?></option> <?php endforeach; ?> </select>


2

I have no idea why this should solve the issue but I can solve it. Use a different file name. For example: include('my_widgets.php'); I get the error you describe with include('widgets.php'); but not with a different file name. I don't know why. I do know that WordPress has a Core file named widgets.php but I can't work out why there should be a conflict. ...


1

Use the_content filter to add data to a post's content without having to touch the template.


1

You're right. It isn't a good structure. You are running three queries on the page-- the two you are creating plus the main query that is being completely ignored (plus ancillary queries). You are also clobbering the main query halfway through the page load when you overwrite $wp_query, which can cause unexpected and unpredictable results and difficulty ...


1

Front Page The page you set to Front Page will be displayed when you visit your website at first (Something like Homepage of your site). If you don't use this setting, your site will display the list of blog posts in stead whenever someone visits the site when the site launches. Posts page The page you set to Posts page will display the list of blog posts ...


0

The issue was with the category name, it started with a number..! I changed it into a string and it now works. 5 hours later....


1

Both are pages. For front page create a page with content. For posts page create an empty page ( no content ). Now select them in customizer accordingly.


1

You setup a Wordpress site in a subdirectory/subdomain or any url of your choice. So, the path structure is up to you. Add all the files and database info in this site. Activate the same plugins and themes. Disable search engine indexing for this site. Set up so that published posts and everything else on the live site are added automatically in this site ...


1

The issue is that whenever Contact Form 7 generates the form shortcode it doesn't create a name attribute and it doesn't seem to fallback to using the title attribute of the shortcode. HTML 5 doesn't like empty name attributes. One solution until this is fixed could be to add an attribute to your Contact Form 7 shortcode html_name and give it some kind of ...


2

In this case i will do: create a new folder inside website root folder (ex: mynewsite) create a new db and import the old website db to it copy old website files and folders to the new directory (mynewsite) change db name, user etc in wp-config on mynewsite folder define site url by adding to wp-config.php ...


-1

Just pass array with category terms in wp_set_post_terms taxonomy parameter. global $post; $post_id = $post->ID;//get the current post id $terms = array('term1','term2'); $taxonomy = 'category'; $append = false; // or true wp_set_post_terms( $post_id, $terms, $taxonomy, $append );


0

There's at least 3 options: You could take the code for the native recent posts widget and modify it in your child theme to work with your custom taxonomy. You could create a new WP_Query using the tax parameters. Or you could use a filter widget_posts_args to modify the default output of the native recent posts widget so it outputs your custom taxonomy. ...


0

put this code in functions.ph define('IMAGES',get_stylesheet_directory_uri().'/img'); where img is the directory where the images for the flags are present <?php get_header(); $queried_object = get_queried_object(); $term = $queried_object->name; switch ($term) { case "china": echo '<img src=" <?php ...


0

I have found a work around for this that works in IE, Chrome and Firefox. And instead of using php approach decided to utilize jQuery. It is not a complete solution but will work in a pinch for anyone else out there that needs to apply this as well. <script type="text/javascript"> /*! jQuery script to hide certain form fields */ ...


0

i think you have some mistake on form creation it should be like [text* text-1 class:form-control placeholder "Name"] Where text-1 is name attribute. So check your end and fix issue.


0

@GrSrv It is not possible in vanilla WordPress as the tags, and categories are separate entities. Categories would offer you a hierarchical parent/child relationship, and could accomplish this. CategoryParent1 CategoryChild1 CategoryGrandchild1, CategoryGrandchild2, CategoryGrandchild3 CategoryParent1 CategoryChild2 CategoryGrandchild1, ...


-1

Add the below code in your single.php file <div class="post-contents"> <?php $args = array( 'posts_per_page' => -1,'orderby'=> 'date','order'=> 'DESC','post_type' => 'post','post_status'=> 'publish'); $myposts = get_posts( $args ); foreach ( $myposts as $post ) : setup_postdata( $post ); ?> <div class="post-single"> ...


0

I was able to do this a while back by following this WooCommerce tutorial: There may come a time where you would like change the text displayed on a product's page when it is In Stock or Out of Stock. Simply add the following code to the 'custom functions' area of your functions.php file: /** * Change In Stock / Out of Stock Text */ ...


0

The get_search_form function doesn't work like that. The parameter that is accepted only specifies if the HTML content is being returned or outputted directly. So this parameter should be a boolean. It still works in your case because PHP simply evaluates the string that you are passing as true considering that it is not an empty string, 0, null etc. It ...


2

You have misspelled the action hook name. This: add_action( 'after-setup_theme', 'ja_theme_setup' ); Should be: add_action( 'after_setup_theme', 'ja_theme_setup' ); The full code: add_action( 'after_setup_theme', 'ja_theme_setup' ); function ja_theme_setup() { add_theme_support( 'post-thumbnails'); }


-1

You need to go your wp-admin/post/ top right corner show "screen Options" click on this and expand screen-option then click on Featured Image check box Hope this help you..


-1

Your code should work , but as it is not working the try the following things add_theme_support( 'post-thumbnails'); Just put this code in functions.php , not within a function . Just put this code on the top of your functions.php file . If it is not working then try this plugin Drag & Drop Featured Image


1

You are not providing the correct parameter to wp_get_nav_menu_object() function. It needs the menu ID or menu slug but you are providing the menu theme location. Obviously, I can not tell you what is the ID or slug of your menu. One way of getting the menu ID of the menu assigned to theme location is using get_nav_menu_locations(): $menu = ...


0

Make all user author to contributor. After no user post directly you blog but submit article for review. Only Admin can publish.


0

If you modify a theme directly and it is updated, then your modifications may be lost. By using a child theme you will ensure that your modifications are preserved. How to create a child theme -> Wordpress Codex quick guide If you want to create functionality that will be reused in your another projects, create plugins. Thanks Vee



Top 50 recent answers are included