Tag Info

New answers tagged

0

Please try replacing print apply_filters( 'taxonomy-images-queried-term-image', '' ); with print apply_filters( 'taxonomy-images-list-the-terms', '' ); For WordPress default post type, I created category.php template and altered your code as below. It is showing category image. You can view the snippet here


0

You can use get_object_taxonomies() as your solution. Returns all the taxonomies for a post type or post object: <?php get_object_taxonomies( $object, $output ); ?> Have you tried anything? something like this? // taxonomy term archives $post_type = get_post_type(); // find out if CPT $taxonomies = get_object_taxonomies($post_type); // Find ...


1

There are a few steps you need to take to add menus, the wordpress way. Register the menu in functions.php using register_nav_menus() Codex Link: https://codex.wordpress.org/Function_Reference/register_nav_menus Example: register_nav_menus( array( 'my_custom_menu' => 'My Custom menu', 'my_other_menu' => 'My Other Menu', ) ); Now you ...


0

If you want to delete all your WordPress website content why not install a new one? Otherwise, you can install a plugin like this one: Bulk Delete where you can delete posts, pages and other elements of the website in bulk.


0

There is a great resource that will explain to you how templating works. http://codex.wordpress.org/Theme_Development#Template_Files Hope this gives you insight.


2

If you want to set which one page is blog page and which one is front page you need to go in administration to the Settings - Reading and there switch "Front page displays" to the "A static page" and below choose the pages.


0

This is mainly because a static link saying Home was added to the menu and then you created another page called home which also showed up in the menu. First let's take care of the static home page setting (if you haven't got that set already) Under Settings and then Reading you'll have the option to select a static page as the homepage and another page as ...


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



Top 50 recent answers are included