Forum Replies Created
-
AuthorPosts
-
September 6, 2017 at 12:23 PM in reply to: Output URL as page title instead of full web address #6907
janek
ParticipantPretty much exactly what I want. I'll have to ask about StackOverlow and see if someone can help me implement it with the short code.
September 5, 2017 at 1:30 PM in reply to: Output URL as page title instead of full web address #6888janek
ParticipantIs there a way to do this and have that page title override the full web address? For instance the user inputs the url "http://www.google.com" and the page title as "Google" then on the front end it just displays the url as "Google".
I mainly want to do this to provide a better experience for visitors and minimise the clutter while also making it easy for an author in the back end to add a list of URLs to the page sidebar.
See link for example of the sidebar in action:
https://a15e3113.ngrok.io/academy-sports/tennis/September 5, 2017 at 10:40 AM in reply to: Output URL as page title instead of full web address #6884janek
ParticipantSo basically I'd like links to display a page title instead of the full url.
For instance if I put http://www.google.com in as URL it would be better if it displayed as Google (page title) instead of the url.
I've attached a imgur gallery showing what I have set up on the backend and frontend
Hopefully this is clear. Let me know if you need to know more.
janek
ParticipantThat worked perfectly. Thank you. ๐
janek
ParticipantThanks Ludovic, I'll try this when I'm back at work on Monday. ๐
janek
ParticipantHi Truong,
Is it possible to make it so the class CSS styling doesn't apply when the shortcode value is empty.
For example I have multiple shortcodes for metaboxes sitting in a widget, without assigning a class to apply padding above each shortcode the outputs run into each other. However if I apply a class and style it with padding above the problem then is if I dont have a value/output for one of the metaboxes it still applies the css padding which leaves a gap between the shortcodes.
I've taken a screenshot of the backend and the frontend metaboxes I'm using
You can see I haven't populated the Videos metaboxs and thats causing a huge gap to appear between the forms and the links due to the padding I've added to the shortcode.
janek
ParticipantDisregard the xmp. Trying to figure out how to display the code without it actually running the code.
Should be able to see the code I'm using via the following link
https://jsfiddle.net/f9et2en3/janek
ParticipantNo worries. Still having problems with this.
Using the code above both links (google.com and googlemaps.com) forward to
http://www.googlemaps.com%3C/li%3E%3C/ul%3E
Complete code for the widget looks like:
<xmp>
<h4>Application and Information Forms</h4>
[rwmb_meta meta_key="applications_forms" type="file-advanced"]
<h4>Links</h4>
[rwmb_meta meta_key="url_1"]</xmp>janek
ParticipantHi Truong,
That code within the widget seems to just turn the URLS to
http://swas.dev/academy-sports/tennis/%5Brwmb_meta%20meta_key=
instead of http://www.google.com for example.janek
ParticipantSorry my knowledge of coding is pretty bad.
Currently I have the shortcode sitting within a widget that appears on a sidebar on my site. If I add the code you supplied to the widget it will not work.
You can see an example of what I've achieved within the sidebar/widget with the original shortcode.
http://7c79b000.ngrok.io/academy-sports/tennis/Sorry for the slow connection, just a temp site at the moment.
If I use your code, where would I need to put it to affect the shortcode within the widget. Or is there another approach I can take to achieve the same result.
-
AuthorPosts