kusuchin
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: How to add shortcode in Custom Links's url (nav-menus)?Thank you, sterndata.
I resolved.
I had installed “Online Lesson Booking system” plugin. I didn’t know the menu of widget was displayed by the plugin. I customized the plugin and resolved it (The shortcode worded well).
<aside id="olb-teachers-menu" class="widget widget_teachers_menu"> <?php if($title){ echo $before_title.$title.$after_title; } if($body){ // customized --> // echo '<div>'.$body.'</div>'; echo '<div>'.do_shortcode($body).'</div>'; // <-- customized } ?>I could not find any filters related to it. I’m sorry.
[Moderator Note: Please post code & markup between backticks or use the code button. Your posted code may now have been damaged by the forum’s parser.]
Thanks a lot.
Forum: Fixing WordPress
In reply to: How to add shortcode in Custom Links's url (nav-menus)?Thanks for your replying, sterndata.
> you cannot use shortcodes when you define a menu under appearances->menus. Is that what you’re asking?
Yes.
[Appearances]-[Menus]-[Custom Links]-[URL]
I want the dynamic url at it and display it with the widgets.
ex. http://*****.com/wp-admin/post.php?post=312&action=edit
ex.
=== MENU === (Widgets)
Home (Static Link)
Page1 (Static Link)
Page2 (Static Link)
Edit Specific Post (Dynamic Link)
Page3 (Static Link)
============I made the shorcord which outputted the dynamic url but it was not worked in “Custom Links”.
I don’t want to achieve my aim with “Text” in “Widgets” because I use the widgets displayed by member-groups.
Forum: Hacks
In reply to: I want to change the title in the search result page.Hi, bcworkz.
Thanks very much.
I had tried to program according to your advice, and it worked!!
Both of “is_search()” and “is_page_template(‘search.php’)” works in functions.php as you said.
function custom_render_title_tag() { if(is_search() || is_page_template('sample.php')) { echo "<title>The Changed Title</title>\n"; } else { add_action('wp_head', '_wp_render_title_tag', 10); // 2 is better because echo's "<title>" line in html file displays near the default <title> line. } } remove_action('wp_head', '_wp_render_title_tag', 1); // need just 1. (not 2 - 9) add_action('wp_head', 'custom_render_title_tag', 2); // need less than 10. (1 - 9)I changed the approach.
(1)Removed default action
(2)Add my customized action
(3-1)In “is_search()” case, my original action (echo “<title>The Changed Title</title>\n”;)
(3-2)Re-Add default action *The action was removed at (1).===
Anyway, “get_page_template_slug( get_queried_object_id() );” is not work (Null) at the search result page. I don’t know why so.
Finally, thanks a lot!!