Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I need help in populating the parameter in the url in the title of the page. What's the best way to do this?
www.mydns.com/sometext1/sometext2
sometext1 | sometext2
Thank you
You want to update the page's title based on the url?
document.title = window.location.pathname.split("/").slice(1).join(" | ");
window.location.pathname gives you {{/sometext1/sometext2}}
split will divide it up
slice(1) will chop off the empty index
join will put it back together
Of if you wanted to achieve this in PHP
<title>My Page<?php echo str_replace('/',' | ',substr($_SERVER['REQUEST_URI'],1)); ?></title>
Related
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 3 years ago.
Improve this question
Well, I Will developer a close blog in laravel, this blog needs take the name of the people who has logged!
I wanna replace for example {[userName]} for auth->user()->name()
I Will write {[userName]} in my text editor Ane show the name of user logged in my view!
i think just use str_replace
eg:
$input = "My name is [USERNAME]";
echo str_replace("[USERNAME]", auth->user()->name(), $input);
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
Improve this question
<?php _e('Copyright-, All rights reserved | Build by this *company- this is the word I want to href*','theme'); ?>
I want to link a word on this phrase, but i dont know what is php_e and how to a href this.
Modify your Code to
<?php _e('Copyright-, All rights reserved | Build by this ','theme');?><?php _e('Company','theme');?>
_e is used to translate output.
Here the doc : https://codex.wordpress.org/Function_Reference/_e
You can just link your word inside, it's not a problem.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I'm trying to create a simple site for local test, but I need to show on URL the following:
?id=1
How can I do it?
You can do this by hyperlink, form submit, manually typing it into the URL bar and many other methods. Use a hyperlink:
ID1
Im not too sure what you are asking, but if you are looking to add an id variable to the URL you need to add it to the URL when you redirect
EX.
From link
Link
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
in my wordpress e-commerce i have plugin that has select option inside the option i want to add text "Popular" to an existing text.
Ex: Medium Tail
Expected Output should be
Medium Tail/Popular
is there a jquery that could insert text?.
I do appreciate Your help Thank you:
Try this code:
HTML:
<span id="text1">Medium Tail</span>
JS: you can use empty and append method to do that:
$(document).ready(function(){
$("#text1").empty().append("Medium Tail/Popular");
});
Plz check it out: http://jsfiddle.net/o1f77e1y/
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
Currently I have:
Click here
This takes me to the index.php page
How do I change this in order to take me to another page?
Since you guys closed this. I will answer my own question:
The answer:
What you put in the WP_Query post_type = '(POST TYPE HERE)'
You can make a page called:
"single-(POST TYPE HERE).php
So once you click the link. This will take you to the:
"single-(POST TYPE HERE).php page
the_permalink() outputs the URL of the post currently being viewed in the loop. If you wanted to change the destination of the link then replace <?php the_permalink();?>.
Refs:
http://codex.wordpress.org/Function_Reference/the_permalink
http://codex.wordpress.org/The_Loop