Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I'm trying to redirect users after commenting on my Wordpress blog, can anyone steer me into the right direct? I just want it to redirect them once.
There are a few ways that you can do this. The first and simplest is just to write a little function for yourself to do it. You could put this into your functions.php file, in whatever theme you are using.
add_action('comment_post_redirect', 'your_redirect_function');
// A function that redirects your users after they have commented.
function your_redirect_function ($location, $comment) {
// Here all you need to do is return the url of your target page.
$page = 'http://www.stackoverflow.com';
return $page;
}
Sometimes it's better to use Wordpress plugins rather than adding functions to your theme's functions.php file, because if your theme has an update then you'll lose your function! There are some plugins available to do this - the most popular one is Yoast's (he has a plugin for everything doesn't he?) You can download it at http://wordpress.org/plugins/comment-redirect/
I've found Yoast's plugin to be a little limited though, because the redirect will only work once for each of your users. This is a good and bad thing - say you want to thank your user for a comment, then you can only do it once. But it's good if you're asking them to sign up to a service, say. The other popular comment redirect plugin that has more features (but it's not free unfortunately) is Comment Redirect.
Again, it's probably better to go for a plugin, because it will have more features - like limiting the number of times each user gets redirected - and it will also survive the updates to your theme.
Use the below filter hook
comment_post_redirect
For more details
http://codex.wordpress.org/Plugin_API/Filter_Reference
More samples below:
http://wordpress.org/support/topic/a-simple-redirect-using-comment_post_redirect-in-functionsphp
http://wordpress.org/support/topic/redirect-after-posting-a-comment
Related
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 1 year ago.
Improve this question
my client is sending a link to costumers across 3 countries with utm to track on google analytics. these links are send through linkedin, fb, twitter etc. something like this:
https://wwww.example.com/page?utm_source=linkedin_stem&utm_medium=cpc&utm_campaign=lk_stem_tkt
https://www.example.com/page?utm_source=facebook_stem&utm_medium=cpc&utm_campaign=fb_stem_tkt
however these links are not being tracked on analytics, i believe due to the language prefix being added as you enter the website, like this:
https://www.example.com/en/page
https://www.exemple.com/es/page
https://www.example.com/pt-pt/page
is there a way to track this utm's without mentioning the language prefix?
Analytics parses query parameters. It doesn't care about the path itself. However, in your examples with lang set, the utm params are missing.
So what I believe your issue is, is a trivial redirection from a url where the language is not set to a url where it's set. During the redirection, you lose your utm-params.
Most likely, the redirection kicks in before GTM has a chance to fire a pageview (utm-params have to be set just on one hit in a session), thus, the attribution is lost completely.
Now the best fix for it would be changing the redirection rule to pass query parameters to the destination url. It should be a trivial task for whoever set up the redirection in the first place. Presuming the redirection is backend-driven. There may be other fixes for GTM, but they are out of scope.
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
I was going through a site and saw that site is developed in wordpress. However, when i land on below page. I am unable to understand whether they have used a wordpress plugin or api to develop functionality:
https://legaldesk.com/affidavits/affidavit-for-change-of-name
Above link shows me a form when I select any city and click on create agreement. It asks for my details and on the right it shows preview.
Please answer . If this question should not be asked here, please do let me know the right site on which I can ask this. I like learning new technologies.
The forms themselves seem to be from "TemplatesForm" sourceforge.net/projects/kobject/files/kobject-java/tests/tests/…
Generally, the process of finding which plugins and scripts is one of a kind of forensic detection using, on the one hand, direct links to scripts' sources, which lead to the publisher's url and on the other, class names and other names or function calls, for example, found in the HTML.
Apart from obvious signs like "Powered by WordPress" or similar lines which some sites will have clearly displayed on them, you can find out a lot from the HTML page source.
Right click your page, select "view source" and search for, for example, "plugins" in the paths you find. One plugin used here is http://codecanyon.net/item/mega-main-menu-wordpress-menu-plugin/6135125 MegaMainMenu also Woocommerce, LayerSlider http://codecanyon.net/item/layerslider-responsive-wordpress-slider-plugin-/1362246 and FlexSlider https://www.woothemes.com/flexslider/
In this case, this is the theme - http://themeforest.net/item/envor-fully-multipurpose-wordpress-theme/9251688
They are also using Visual composer WYSIWIG plugin to help build it. codecanyon.net/item/visual-composer-page-builder-for-wordpress/…
You can launch scripts in browser windows as text by clicking on links to them in the HTML itself (at your own risk but it usually pops up in the browser as text) and you will often find the licence agreement texts at the top of the script.
You can see what national language the script has traces of to establish nationality (for example the forms scripts have traces of French in their variable names, which match with those on this site) This will help to confirm if you have discovered a script which was produced in the country you expect.
You can also see what programming language is involved, to help in your search and understanding of how the site works.
Website traffic in this case is monitored by Data Sumo Me https://sumome.com/ and Google Analytics. Also the Yoast WordPress SEO plugin is used. The URLs and names here are fairly obvious in the page's HTML and in HTML comments.
The part that pops up the overlays wordpress.stackexchange.com/questions/95661/… myModalLabel is BootStrap Modal - More on Modal Popups from http://www.tutorialspoint.com/bootstrap/bootstrap_modal_plugin.htm which seemed a very clear tutorial and explained the application of modal popups well.
More on Modal dialogue boxes - there is plenty you can do with those and they have been used extensively on this site en-gb.wordpress.org/plugins/modal-dialog modal-dialog for popup dialog boxes - you may find other bits on this site, including the usual jquery, bootstrap and fonts/css.
Another script called "imageareaselect odyniec.net/projects/imgareaselect is used for selecting image areas.
As this question is a little "off topic" for Stack Overflow you should probably try on Wordpress StackExchange, wordpress.stackexchange.com though they don't actually recommend any specific plugins as a matter of policy. I am also not recommending any here, only answering your question as to what has been used here and hope that the focus on what actually makes it work will be of use and interest to programmers who read this answer.
I can't see any other ones indicated in your webpage example - there may be some I have not noticed, but this answer is also intended partly as an example of the forensic analysis processes involved in working out what powers a site, which is at least partly within the scope of StackOverflow and I hope you will be able to use it to help you complete the discovery of any I missed. This started out as a collection of comments but seemed to develop a life of its own.
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
Lately I've noticed that some sites (such as jsFiddle) and some widgets such pinterest feed widget, and many others.
They started to use links in the format
//code.jquery.com/jquery-1.9.1.js
//assets.pinterest.com/js/pinit.js
what does the // means ?
is it the same as http ?
if // is the same as http why using it instead of http ?
if both are different, can I use it to link my website ?
as addition: I'm not sure, but I think I've seem some use //name:sub.domaine.com, am I wrong ? if those exist, what do they mean ?
Edit:
as explained in an answer bellow, I can use the // notation to make my links shorter, but when I use it for my website: Chrome changes the link to: file:/// which is not what I expected
This is a protocol-relative URL. If the page which includes it uses HTTP, then it's HTTP. If the page which includes it uses HTTPS, then it uses HTTPS.
This is convenient so that you can ensure that you don't fetch insecure resources in a secure page (this causes the "mixed content" warning you might have seen), without bothering with the overhead of SSL/TLS in a page which is delivered unencrypted anyhow.
It's similar to how URLs beginning with a single / are resolved relative to the current protocol and hostname, and URLs with no leading / or scheme are resolved relative to the current page's directory.
To keep it simple: most web browsers now do not require the full [http://www] anymore. So yes, to be cool and to keep the URL's short, you can skip the full [http://www.] and just use //
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
I have studied most of the posts concerning web page being viewed in an iframe here but I was wondering if this can hurt the SEO of the framed site! I own a niece blog, lets call it mynieceblog.com and I recently found out that my web content, mynieceblog.com/mypostname.html, is viewed in an iframe by a site acting like a blog aggregator. A toolbar exists on top (has a closing button) and the url looks like aggregator.com/content/myposttitle.html The visitor can view my entire site content through this iframe and has the opportunity to visit relevant posts of other aggregated blogs. Here are my questions:
a. When a user visits mynieceblog.com/mypostname.html who gets to see visits/impressions on his google analytics?
b. Do I get incoming links from aggregator.com? Could this be possible only if the user closes down the toolbar?
c. Does this hurt the ranking of mynieceblog.com since I both see mynieceblog.com/mypostname.html and aggregator.com/content/myposttitle.html in search engine results for some keywords?
The view of my blog content through this aggregator does not hurt my site reputation. I have read that bandwidth use is an issue too! I am more concerned about my rankings and page views.
It can't harm you and probably gives you some credit. You found it yourself so it's getting traffic.
Your own Google Analytics code will be run so you will see the visitors. You can actually tell who is framing your website via the Hostname parameter in Google Analytics. Hostname seems to get set to the domain shown in the address bar.
Google does see the link but how much ranking you get from that is unknown. Somewhere between 0 and 100%! I have recently read a test where someone believed some framed content was indexed.
It cannot hurt your ranking. Worst case is that it ranks higher for a keyword so Google presents their page for you instead of yours directly.
If you're really worried about it then you could implement some JavaScript code to make your page break out of the frame. Something like this:
if (top.location != location) {
top.location.href = document.location.href;
}
If your viewer views your website through aggregator.com then surely i wont help you for SEO. For good SEO viewers needs to visit your site directly from aggregator.com
It's not a question of hurting your site reputation - it won't; however, will it benefit your site? I'm unsure, but if you get any benefit, I imagine it would be less than if your site was access directly.
As this article suggests, the SEs may be able to spider your content through the aggregator, but the aggregator won't gain from your content (framed content is rightly considered to be outside the site), and given the dynamic architecture of many aggregators, you may also not gain much/anything.
I would imagine that the you could consider exposure of your site through an aggregator could be considered an in-bound link, but it is unclear whether SEs would agree.
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I have a Drupal 7 multi-language(3) website. I have installed the Internationalization (7.x-1.0-beta2) module.
I have created for each language a page, and translate it into two others languages.
Now here is what I want to do: to set a kind of intelligent "front-page" to know what language is selected and set the front page (which I choose) in that language.
How can I do this? I know that in Internationalization module, there is no such kind of thing, am I right? If I set the front page to nothing I get this message: “No front page content has been created yet.” which is normal because Drupal is asking me for one front-page to be set, however I want to have for each language a front-page.
Might be late to the party with this answer, but after many hours spent trying to solve this myself, I've the following solution.
For Drupal 7:
1- Make sure you have the modules Variable and Variable Translations switched on.
2- Goto admin/config/regional/i18n/variable
3- Select the 'Site information' list tab and check 'Default front page', save settings.
4- Goto admin/config/system/site-information, you'll notice a block of text there saying something about some of your settings being multilingual variables and a list of links for the languages you are running which allow you to set the settings for each language.
Now, this is where the real GOTCHA comes up... clicking those links and changing the settings does nothing. Your left with the same settings still for all languages. The way around this?
Check the URL you are currently on, the entire thing, so something like: http://www.example.com/en/admin/config/system/site-information/
Notice the language prefix there before /admin?? To change the settings for the other languages you want to use, switch the prefix in the URL and then make your changes. And now, as if by magic, multiple front pages, properly changing based on language.
This must be a bug in Drupal, I should get around to opening a ticket. But for now, if someone else comes across this, I hope it solves your problem too.
I've been searching for the same. I 'd like to recommend Drupal 7 - multi-lingual front page node which is complete and works perfectly for Drupal 7 projects.
After continuing to rip my hair out over this, I found out that this feature is incompatible with anonymous page caching!
Go to /admin/config/development/performance and turn off page caching for anonymous users.
May be there is a better way but finally he is how I did.
I have added in template.php the following code:
/**
* Implements hook_preprocess_page().
*/
function aelius_preprocess_page(&$vars) {
if ($vars['is_front']) {
$langcode = $GLOBALS['language']->language;
if ($langcode == "en") {
drupal_goto('home');
} elseif ($langcode == "fr") {
drupal_goto('accueil');
}
}
}
I haven't worked with Drupal 7 i18n yet, but in Drupal 6 you would add a site_frontpage variable to $conf['i18n_variables'] in settings.php and then switch to each language in turn and set the frontpage on the site information page.
Alternatively, you can specify a condition in your theme front-page.tpl.php like so