Congratulations to a man categories php cat id. Musical birthday greetings. Benefits of audio greetings


Our distant ancestors were once forced to use pigeon mail and the services of messengers to send messages over long distances. Then the primitive telegraph was invented, and paper mail appeared around the same time. And for a long time we still had to send congratulatory telegrams or postcards in advance. But all these archaisms are a thing of the distant past. Now you can send a voice happy birthday greeting to your phone at any time to anyone close and dear to you in just a couple of minutes!

Happy birthday voice greetings are the best gift for friends and family

The holiday morning should begin with congratulations and gifts! Do you want to please a loved one with a cool surprise, but don’t know how to do it? If vocals are not included in the list of your merits and talents, then it is better not to sing “Happy bezdeyo tu yuuuu” into the phone early in the morning. You can order birthday greetings from us by phone. Choose a cool voice greeting from Putin with Yotafon and Lada Kalina as a gift, a comic prank from the brave Emergencies Ministry, a personal greeting from the shocking Zhirinovsky, a fiery Georgian ditty, a parody, a soulful song. We have sound happy birthday greetings on your phone for children and adults for every taste!

Advantages of audio happy birthday greetings on your phone

It is not always possible to please the birthday boy with fireworks, sweets, champagne and gifts from the very morning. If your friend or family member is very far away, then you can limit yourself to a banal phone call in the morning. Do you also think that this is very boring and old-fashioned? Then take advantage of the possibilities of new technologies - order happy birthday greetings to your phone and give a great mood! Such a joke or musical gift will surely please the birthday boy. He will be pleasantly surprised by your unusual surprise!

Choose the best themed birthday voice cards

Our service of voice cards, SMS congratulations and telephone pranks contains a golden collection of jokes, jokes and musical compositions. You can choose any happy birthday greetings. the site has prepared audio gifts for your brothers and sisters, parents, friends, loved one, employees and neighbors. All birthday greetings are cool and funny. Do you want to please the birthday girl with a fiery Georgian ditty, a parody of the famous heartthrob Nikolai Baskov, or a soulful song from Lev Leshchenko? We have any birthday greetings you can call on your phone!

  • Happy birthday voice greetings by name from A to Z will be a pleasant congratulatory surprise for the birthday boy. Such a musical or comic greeting is perceived as prepared personally for him!
  • Musical cards for the zodiac sign will delight the slightly superstitious horoscope reader and bring him good luck for the whole next year.
  • Voice greetings for a woman's birthday will be a wonderful gift for mothers, grandmothers, teachers or girlfriends.
  • Postcards for your loved ones, funny, from celebrities will help you talk about your feelings, cheer you up and put you in a positive mood.
  • Themed congratulations for a sister, girlfriend, boyfriend, grandmother or child will allow you to choose the most suitable individual gift.
  • Voice congratulations on a man’s birthday will be a wonderful surprise for his anniversary, and will delight a good old friend or good friend.

Our SMS birthday greetings contain kind and sincere wishes. Do you find it difficult to find the right words to express your love and gratitude to a loved one, to thank him for many years of strong friendship? Choose ready-made birthday greetings for a man or woman, send a voice card and don’t worry about a thing!

Give your loved ones warmth, care and positive emotions!

Today our goal is to create a hierarchical structure of categories. It is important for us that it is convenient to store categories and that it is easy to display them where we need them.

Sometimes simple things seem complicated, which is why I’ll post a few code fragments that I hope will be useful to you for implementing PHP categories in the form of a tree.

So, the structure should consist of the category id (id), the category name (name) and of course the id of the parent category (parent_id). In MySQL it looks like this:

CREATE TABLE IF NOT EXISTS `category` (`id` int(10) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(255) NOT NULL, `parent_id` int(11) NOT NULL, PRIMARY KEY (`id`)) ENGINE =InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=0 ;

Minimal and clear table structure for storing categories.

INSERT INTO `category` (`id`, `name`, `parent_id`) VALUES (1, "Phones and tablets", "0"), (2, "Cars", "0"), (3, "Samsung ", "1"), (4, "Apple", "1"), (5, "LG", "1"), (6, "Ford", "2"), (7, "Lexus", "2"), (8, "BMW", "2"), (9, "Galaxy Tab 4", "3"), (10, "Galaxy S6", "3");

Where the value parent_id=0, this category does not have a parent category.

Everything here is clear and simple. Now let's get down to displaying the list of categories. But to display the list correctly, we first need to get the entire list of PHP categories, and only then use recursion to form our tree. The following function is designed to get this list:

Function get_cat() ( //database query $sql = "SELECT * FROM category"; $result = mysql_query($sql); if(!$result) ( return NULL; ) $arr_cat = array(); if( mysql_num_rows($result) != 0) ( //In the loop we form an array for($i = 0; $i< mysql_num_rows($result);$i++) { $row = mysql_fetch_array($result,MYSQL_ASSOC); //Формируем массив, где ключами являются адишники на родительские категории if(empty($arr_cat[$row["parent_id"]])) { $arr_cat[$row["parent_id"]] = array(); } $arr_cat[$row["parent_id"]] = $row; } //возвращаем массив return $arr_cat; } }

//get the directory array $result = get_cat();

Now we need a function with recursion

Function view_cat($arr,$parent_id = 0) ( //Conditions for exiting recursion if(empty($arr[$parent_id])) ( return; ) echo "

    "; // loop through the array and display it on the screen for($i = 0; $i< count($arr[$parent_id]);$i++) { echo "
  • " .$arr[$parent_id][$i]["name"]."; //recursion - check if there are any child categories view_cat($arr,$arr[$parent_id][$i]["id"] ); echo "
  • "; ) echo "
"; }

Now all that remains is to display the directory on the screen using a recursive function

View_cat($result);

And in general that's all. This way we can get a complete category tree with endless subcategories.

On our birthday, our loved ones expect pleasant congratulations and surprises. Everyone around them is trying to congratulate them, surround them with attention, and express their love and care. But there is always a desire to stand out from the crowd of congratulators. We always want to show a person in a special way how dear he is to us. There is a great modern way to congratulate the birthday person. Musical cards will be an excellent birthday gift. You can choose any song or melody you like that your friend will like. Exactly musical birthday greetings They will surprise your loved ones, give them a great mood, and allow them to have fun and enjoy their birthday even more. On the Pozdravok website you can choose musical cards for people of any age and gender. We offer you a huge range of audio congratulations that you can immediately send to the birthday person. Be sure that the birthday boy will remember the cheerful song for a long time. have no doubt that he will cherish the musical greeting as the most expensive gift.
A musical congratulation is an excellent option for congratulating your loved ones. Just imagine how nice it is to receive such an original surprise from your loved one on your birthday. Poems to your favorite song or a comic congratulation that will be sent to the phone of the hero of the occasion can not only congratulate you, but also charge you with positive energy for the whole day. A great mood is the key to an interesting, fun birthday celebration, a sea of ​​impressions and joyful moments that you will remember for a long time with your friends. Give to your loved ones musical birthday cards for your phone , surprise and delight your loved ones with your originality and creative gifts.
A birthday is the day when you can express all your feelings and emotions to the hero of the occasion. Those words that you cannot express to your loved one due to embarrassment, you can convey happy birthday greetings into audio. He will be delighted and happy to receive such an unusual surprise from his beloved.

Greetings to all blog readers WordPress Inside in 2011, congratulations on the upcoming and upcoming holidays, I wish you much health, happiness and joy for the next 360 days. As I promised in my article about plans for the next 2011, I’m working on improving all my main blogs a little - updating systems, installing the latest versions of plugins and delving into templates for the sake of optimization and bug fixes. The work was extremely difficult, I would even say very painstaking - you find one inaccuracy, decide to correct it, and in front of you are 5 separate projects, for each of which you need to make corrections. Well, since I have already planned to do all this, there is no turning back, at the same time I am gaining additional experience in the process and have already found about 5-6 topics for new blog posts :) Today we will talk about categories and functions for displaying them.

In one of the previous blog articles, I published a hack that helps. This solution was used for the function of displaying a list of categories in the sidebar using the wp_list_categories function. The output would be something like this:

Safety

If the title attribute has at least some significance for SEO, then it would be much more useful to simply place the category name there, and not all this unnecessary text. Actually, the above link to the hack helped solve this problem. But here’s the problem, all this was true (worked) for , which made it possible to pre-process the resulting list without displaying it immediately. But what about other functions for displaying categories? - that is the question.

For example, today I discovered quite by accident that a bunch of unnecessary text is written in the title attribute of a link when displaying a list of categories for a specific post.

The whole problem was that it is used here the_category function, for which, unfortunately, you cannot set a parameter so that the result of its call is not displayed immediately. But WordPress has another function, get_the_category, which returns an array of category objects for a specific post.

get_the_category function

The syntax of the get_the_category function is quite simple:

cat_name; ?>

Programmers know that the zero parameter of an array outputs the first element, and this actually explains how this code works.

ID); var_dump($categories); ?>

ID); var_dump($categories); ?>

To do this, you need to pass the post id as a parameter to the function, which is what happens in the code.

By the way, I use this function on some sites to display the name of the post category, but without an active link - it’s just additional useful text on the page. In this case, you can use the code:

cat_name . " " ; ) ?>

cat_name . " "; ) ?>

Well, and finally, after a little thought, we came up with a hack for displaying a list of categories for a post without using the the_category function, which we successfully replace with get_the_category. If you want to add code directly to the place in the template where categories are displayed, for example, the archive.php file, then write something like:

You could, in principle, place the code for displaying categories in a functions file, and then in the template files change the_category to a new function, for example, called my_thecat(). Of course, do not forget to add the appropriate code to the functions.php file before replacing:

function my_thecat() ( global $post ; foreach ((get_the_category($post -> ID ) ) as $category ) ( echo " cat_ID) . "" title="" . $category -> cat_name . "">" . $category -> cat_name . "; " ; } }

function my_thecat() ( global $post; foreach((get_the_category($post->ID)) as $category) ( echo " cat_ID)."" title="".$category->cat_name."">".$category->cat_name."; "; } }

I tested it, everything works. Only one question remains - how useful and extremely necessary is all this? If you have one blog with a consistent design that you want to make the best, then you can take a couple of minutes and make the appropriate changes. If you have a lot of such blogs, I think that manipulating the title will not bring any special SEO benefit in terms of it, it’s easier to buy links in Rotapost to all these projects - by the way, the experiment to raise the TIC in the system has been successfully and positively completed, there will be a report on this soon.

Displaying custom post categories

The comments suggest that the examples above do not work for custom (user) post types. I have not encountered this problem, so I can only advise you to google the solution in English-language blogs using the keyword wordpress custom post type show category or use the hint from user Stinker (from the comments). Where the categories are displayed, you just need to paste the code:

Where categoria_video is the taxonomy of the user post (aka custom). And now in more detail from where and what. For example we have:

// Recording type Video if ( ! function_exists ( "video_cp" ) ) ( function video_cp() ( $labels = array ( "name" => _x( "Video" , "Post Type General Name" , "video" ) , "singular_name" => _x ( "Video" , "Post Type Singular Name" , "video" ) , "menu_name" => __( "Video" , "video" ) , "parent_item_colon" => __( "Parent:" , "video" ) , "all_items" => __( "All videos", "video" ) , "view_item" => __( "View" , "video" ) , "add_new_item" => __( "Add new video", "video" ) , "add_new" => __( "Add video" , "video" ) , "edit_item" => __( "Edit Video", "video" ) , "update_item" => __( "Update video" , "video" ) , "search_items" => __( "Find video" , "video" ) , "not_found" => __( "Not found " , "video" ) , "not_found_in_trash" => __( "Not found in cart", "video" ) , ) ; $args = array ( "labels" => $labels , "supports" => array ( "title" , "editor" , "excerpt" , ) , "taxonomies" => array ( "categoria_video" ) , // the category we will create below (aka taxonomy)"public" => true , "menu_position" => 5 , "menu_icon" => "dashicons-id-alt" , ) ; register_post_type( "video" , $args ) ; ) add_action( "init" , "video_cp" , 0 ) ; // initialize) if ( ! function_exists ( "categoria_video" ) ) ( // Categories for vacancies function categoria_video() ( $labels = array ( "name" => _x( "Video Categories", "Taxonomy General Name" , "categoria_video" ) , "singular_name" => _x( "Category Video", "Taxonomy Singular Name" , "categoria_video" ) , "menu_name" => __( "Categories" , "categoria_video" ) , "all_items" => __( "Categories" , "categoria_video" ) , "parent_item" => __ ( "Parent category Video", "categoria_video" ) , "parent_item_colon" => __( "Parent category Video:", "categoria_video" ) , "new_item_name" => __( "New category", "categoria_video" ) , "add_new_item" => __( "Add new category", "categoria_video" ) , "edit_item" => __( "Edit category", "categoria_video" ) , "update_item" => __( "Update category", "categoria_video" ) , "search_items" => __( "Find" , "categoria_video" ) , "add_or_remove_items" => __( "Add or remove category", "categoria_video" ) , "choose_from_most_used" => __( "Search among popular", "categoria_video" ) , "not_found" => __( "Not found" , "categoria_video" ) , ) ; $args = array ( "labels" => $labels , "hierarchical" => true , "public" => true , ) ; register_taxonomy( "categoria_video" , array ( "video" ) , $args ) ; ) add_action( "init" , "categoria_video" , 0 ) ; // initialize }

// Post Type Video if (! function_exists("video_cp")) ( function video_cp() ( $labels = array("name" => _x("Video", "Post Type General Name", "video"), " singular_name" => _x("Video", "Post Type Singular Name", "video"), "menu_name" => __("Video", "video"), "parent_item_colon" => __("Parent:", "video"), "all_items" => __("All videos", "video"), "view_item" => __("View", "video"), "add_new_item" => __("Add new video" , "video"), "add_new" => __("Add video", "video"), "edit_item" => __("Edit video", "video"), "update_item" => __("Update video ", "video"), "search_items" => __("Find video", "video"), "not_found" => __("Not found", "video"), "not_found_in_trash" => __("Not found in cart", "video"),); $args = array("labels" => $labels, "supports" => array("title", "editor", "excerpt",), "taxonomies" = > array("categoria_video"), // the category that we will create below (aka taxonomy) "public" => true, "menu_position" => 5, "menu_icon" => "dashicons-id-alt",); register_post_type("video", $args); ) add_action("init", "video_cp", 0); // initialize ) if (! function_exists("categoria_video")) ( // Categories for vacancies function categoria_video() ( $labels = array("name" => _x("Video Categories", "Taxonomy General Name", "categoria_video "), "singular_name" => _x("Category Video", "Taxonomy Singular Name", "categoria_video"), "menu_name" => __("Categories", "categoria_video"), "all_items" => __(" Categories", "categoria_video"), "parent_item" => __("Parent category Video", "categoria_video"), "parent_item_colon" => __("Parent category Video:", "categoria_video"), "new_item_name" => __("New category", "categoria_video"), "add_new_item" => __("Add new category", "categoria_video"), "edit_item" => __("Edit category", "categoria_video"), "update_item" => __("Update category", "categoria_video"), "search_items" => __("Find", "categoria_video"), "add_or_remove_items" => __("Add or remove category", "categoria_video"), " choose_from_most_used" => __("Search among popular", "categoria_video"), "not_found" => __("Not found", "categoria_video"),); $args = array("labels" => $labels, "hierarchical" => true, "public" => true,); register_taxonomy("categoria_video", array("video"), $args); ) add_action("init", "categoria_video", 0); // initialize)

Thanks to user Stinker for the tip, you might find it useful.

P.S. Guard. In one of the Runet blogs we found a wonderful selection of WordPress portfolio themes from 17 free high-quality templates.

Editor's Choice
In recent years, the bodies and troops of the Russian Ministry of Internal Affairs have been performing service and combat missions in a difficult operational environment. Wherein...

Members of the St. Petersburg Ornithological Society adopted a resolution on the inadmissibility of removal from the Southern Coast...

Russian State Duma deputy Alexander Khinshtein published photographs of the new “chief cook of the State Duma” on his Twitter. According to the deputy, in...

Home Welcome to the site, which aims to make you as healthy and beautiful as possible! Healthy lifestyle in...
The son of moral fighter Elena Mizulina lives and works in a country with gay marriages. Bloggers and activists called on Nikolai Mizulin...
Purpose of the study: With the help of literary and Internet sources, find out what crystals are, what science studies - crystallography. To know...
WHERE DOES PEOPLE'S LOVE FOR SALTY COME FROM? The widespread use of salt has its reasons. Firstly, the more salt you consume, the more you want...
The Ministry of Finance intends to submit a proposal to the government to expand the experiment on taxation of the self-employed to include regions with high...
To use presentation previews, create a Google account and sign in:...