get_depth()
2010-01-16 @ 14:54I created a function that returns the depth of a page or category. The depth is how many levels from the root the page or category in its hierarchy. The root level number is 0.
I created a function that returns the depth of a page or category. The depth is how many levels from the root the page or category in its hierarchy. The root level number is 0.
The function converts a post / page name to a post /page ID.
This is very useful. I did not know about 'get_var'. This is a very quick way to get an specific property of a post/page without having to inspect a post [...]
[...] into a publish id. I’ve had a glance around on the internet and handled to locate this link http://world wide web.devdevote.com/content management systems/wordpress-hacks/get_id_by_publish_tit... which provides the next [...]
Agree with Rama. Even get_by_postname would work...good for anti-collision in a plugin.
I created a function that returns an URL when sending a post / page name as an in parameter. Put the function into your functions.php in your theme folder.
This is my approach for the same problem
function get_permalink_by_title($title){
$page = get_page_by_title($title);
$pageID = $page->ID;
$permalink = get_permalink($pageID);
return $permalink;
}
This piece of code is great. But if you have made significant revisions to the page (like changing the slug) it gets messed up and shows a slug such as [...]
This solved a problem for me - many thanks!
I created a function that returns a value depending of the input type. Put the function into your functions.php in your theme folder.
quick finding a solution for linking get_category_link(get_single_cat('ID'))
maybe you have some best one ?!
I searching for multiple category display in the loop right now :)
Thx you for reading me !
Hello :)
I would like to make it with links (linked cat name), It's possible?
Optionaly can you help with child cat names? (not single)
Thank you so much
(adding display-posts-shortcode categories)
thanks jen , its work for me , i have try it at my categorie page
Wordpress have a built in function called get_currentuserinfo. A global variable is set. It calls a function to get the user information. It then echos the username. The code is not as short and easy as it could be.
Hi, this is a great piece of code, thank you! :)
Since you say if we have any ideas we can write a comment and you’ll look into it, I have [...]
Thanks man... this was just what i was looking for...
:)
Try this:
echo get_user(‘email’);
Wordpress have a ”bug”. It doesn’t add a current_cat_ancestor class to the wp_list_pages function. If you need it, you can use the code below.
much thanks for sharing this code, worked great with a 3.3.1 install i'm working on.
Can modify with css tab navi manu?
I put the code in my functions.php file, then got this error: syntax error, unexpected ';', expecting ')'
The error is in the line Phil is referring to above.
I changed [...]
If you need to add a stylesheet, a javascript file or Google Analytics code you normally need to edit your theme header.php file. Add additional code to your header WITHOUT editing your theme with Add to Header.
Great plugin. Thanks! I'm happy to make donation to help support this plugin.
Jens, that's a great little plugin. Many thanks.
Add to Header - Wordpress plugin - Script & code, stylesheet (CSS), Javascript (JS) & Google Analytics | devdevote.com I was suggested this website by my cousin. I am [...]
Unlike many other page navigation plugins, this one is based on a core page number function called paginate_links. You can modify the paging styles in many ways.
[...] WordPress page number download sitesinden indirmemiz gerekiyor, daha sonra Plugins/ yeni menüsünden eklentimizi [...]
Thank you for nice plugin.But there is one problem.I want to see 5 post i.e Can you suggest me how we change the number of records in a page to [...]
Thanks for sharing this plugin, but also let me know if WP Paging is good or pagenavi good ?
I want to use SQL-querys within the Wordpress loop and still be able to use the template tags. Here is the solution.
Hello,
Thank you for your post. This could be the right solution of my problem. BUT: what i shall do for this query: i want to show posts from category A [...]
Btw, this blog does not have a "Subscribe to comments" function, so if you respond, could you pls write to me. Thx!
Thanks Jens. After mucking about with so many WP_Query sites online, I just tried your very simple and powerful code. So tweakable!
Question: do you know the "taxonomy" type for [...]
What I don’t like with wp_list_pages is that you can’t exclude or include pages by NAME. Only by ID is available. Here is the solution.
Really helpful! You wrote a beautiful script for WP programmers.
Thanks
Shaun
Yes Jens! Yes!
Are many days I'm looking for this solution!
It was impossible to find information about what you wrote.!
Thanks!
From now on you have a new user who follows your website.
Big [...]
The famous blog platform
2013-07-08 @ 08:10
very good peace of code :D
as for idea i when i was using your code in my theme i face a situation that i have to show categorys only on [...]
2013-01-27 @ 17:34
I found this blog , “get_depth() - get depth of a page or category - Wordpress
template tag / function | devdevote.com”, quite pleasurable and also it
was a good [...]
2012-01-06 @ 00:55
Hi, great tutorial! I've got one question though. I'd like to show sidebar1 for depth1, sidebar2 for depth2 and so on. Any idea how to achieve this?
At this point I'm [...]