Wordpress: Using relative URLs in the Menu using Custom Links - wordpress

When I try to use relative URLs when creating menus in Wordpress...Wordpress always prepends "http://" to the relative path after I click Save. How do I prevent Wordpress from prepending the "http://" in the URL field?
I think I read to change a bit of code in wp-includes/nav-menu.php, but I'd prefer not changing any core code...just in functions.php if necessary.
Any ideas?

Related

add other then default footer in WordPress v6.0

I am new in WordPress,
I want to know how to add footer other then default footer
( example: Footer file name - home-footer.php and need to use for home page, same as contact-us-footer.php for contact us page ). let me how i can achieve this.
if you are adding your files in theme or WordPress core files then this will automatically remove when your WordPress will be updated unless you creat child theme so just better to create to footers with any page builder I recommend elementor and then hide that with page id you will find that in the body tag of every page like this
.page-id-111 .footer{
display:none;}
Let me know if you don't understand anything
You have to name the file footer-home.php. Then you can call this footer in the page template (i.e. page-home.php) using get_footer('home').
Wordpress will use the right file, if it is named correctly starting with footer-*.php.

How to remove the slug of a theme in wordpress URL

Here is the url in browser i want to change tu.edu.pk/#kingster-moblie-menu to tu.edu.pk/#tu-moblie-menu
Please Hepl me out how to reslove this issue.
You can try this js on your js file
// Replaces the location of the current window with the new one.
window.location.replace("https://www.tu.edu.pk/#tu-moblie-menu");

how to add suffix url wordpress example (/post-name/images)

I want to show post images into a separated page for example blow URL:
/post-name/images
At the moment this URL returns a 404 page.
how to show my images in this URL?
WordPress has a get_attached_media() function as Version 3.6, that returns an associative array of all of the images attached to a post.
After that, there are a couple of ways to add the /images path to the URL.
You can use the template_include filter
to check the current URL, unset the is_404 boolean, and pass in a PHP Template.
You can make use of This WPSE Answer to add /images as a "virtual page" using .htaccess and/or WP::parse_request() rules, and load in a PHP template that way
You could instead use query parameters /post-name/?images=true and check for that in your single.php (or equivalent file), and use get_attached_media()
You could instead use query parameters /post-name/?images=true and make use of the the_content filter in your functions.php file, and return the get_attached_media() instead of the content

Translate Multi Lingue Header Top and Header Main

How can I translate the header-main and the header-top of a page? Link: novosite.iqnus.com.br
Maybe there is some hook to add in the functions.php file.
Thanks.
0) Read the translation docs: https://codex.wordpress.org/I18n_for_WordPress_Developers
1) Make sure the strings you want to translate are recognized in your Themes' gettext files - recompile and translate them accordingly and make sure the correct language files are available in the languages directory of your Theme
2) Every dynamic content can be translated by using Plugins like WPML or qTranslate
Try This plugin it's useful for Translate Multi language Header Top and Header Main
https://wordpress.org/plugins/gtranslate/screenshots/
You can put short code header.php where you show.

Using the WordPress TinyMCE in an HTML iframe for plugin

I have a WordPress plugin with settings page. On this settings page, the form to be submitted is loaded in an iframe. I wish to utilize the WordPress TinyMCE for a textarea in this form.
How do I achieve this? I can't really do it the way it is stated here (http://keighl.com/post/tinymce-in-wordpress-plugins/) since the form is present in an HTML file.
WORDPRESS 3.5 UPDATE BELOW
If you're using Wordpress version<3.0, you can use the post you referenced to, it's great.
If your wordpress version is above 3.0 (aka newer versions) you can't use the wp_tiny_mce function for the tiny_mce, because it's deprecated. You need the newer function, wp_editor, which you can read all about it in here:
http://codex.wordpress.org/Function_Reference/wp_editor
For you to use of the wp_editor function and other WP elements your iframe (the for now containing only html and not linked into wp), you need to make your the iframe html file a php file, and add a require function of wp-load.php file.
For example, if your iframe file is in your server's root folder with your wordpress install, all you need to do is to place the following in the top of your file:
<?php
require('./wp-load.php');
?>
//iframe html/php code here
After you do that you can use any wordpress function in your iframe, including the tiny_mce.
---- UPDATE ----
If you are using wordpress 3.5 or higher, the implement method has slightly changed. more information is right in this short tutorial

Resources