i have two wordpress sites, one in root and another in a subdirectory, named fr.
For the wordpress in the root directory the facebook share is working fine, but in case of subdirectory its not working.
here is my links
https://www.acanac.com/blog/general-category/your-go-to-halloween-safety-and-party-blog/ - Working fine
https://www.acanac.com/fr/blog/general-category/votre-blogue-de-reference-sur-la-securite-et-les-fetes-a-lhalloween/ - Not working
This is the code i am using in my site.
<a onClick="window.open('http://www.facebook.com/sharer.php?s=100&p[title]=<?php the_title() ?>&p[url]=<?php the_permalink() ?>&p[images][0]=','sharer','toolbar=0,status=0,width=580,height=325');" href="javascript: void(0)" class="" title="" href=""><i class="fa fa-facebook icon"></i></a>
Can any one please help me..... Thank you in Advance.
Related
I have the following folder structure on my local -
xampp\htdocs\wordpress\wp-content\themes\mdbblog
on my local and under this directory, have following files -
I activated mdblog theme from http://localhost/wordpress/wp-admin/ and able to access the index page of my site http://localhost/wordpress.
The problem is I am unable to href any other page from home page.Following is my code to access Gallery in the menu -
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" id="navbarDropdownMenuLink" data-toggle="dropdown"
aria-haspopup="true" aria-expanded="false">Gallery</a>
<div class="dropdown-menu dropdown-primary" aria-labelledby="navbarDropdownMenuLink">
<a class="nav-link" style="padding:5px 10px;" href="./clinic-gallery-page.php">Clinic </a>
<a class="nav-link" style="padding:5px 10px;" href="patients-gallery-page.php">Patients</a>
</div>
</li>
When I click Clinic, I get following error -
I have no clue as what am I doing wrong here. I new to PHP and Wordpress. I also don't see any pages present under mdblog theme on admin. Is that expected? Any help is much appreciated.
Ok, sooo WordPress isn't exactly a file request type system.... WordPress will only resolve based on your db... Read te docs or ask more direct questions. I advise you:
Create a page. .. this pages will register a route (sortoff) on your db
Assign that page to your menu
Big warning. When you create a localhost page on development, this will be written like that on your db. When you take this to a production server, you will end up with some links as localhost and some as the domain. U will either always have to redirect, or before you upload your db to production, you can dump the sql, and do a find localhost and replace with your new domain on notepad ++
Unless you are creating your own theme. I wouldn't add files directly to your theme as it can be overwritten on an update. Create a plugin.
I am using facebook sharing through facebook sharer , everything is working fine except the image share, by default it is taking the logo image but i want different image.
here is the code which I am using
<a onClick="window.open('http://www.facebook.com/sharer.php?s=100&p[url]=<?php echo $fb_url; ?>', 'sharer', 'toolbar=0,status=0,width=548,height=325');" href="javascript: void(0)"> <span><i class="fa fa-facebook" aria-hidden="true"></i></span> </a>
Any kind of suggestion would be highly appreciated, Thanks for reply in advance in comment box.
I'm building a site on Wordpress and using html5blank theme for the first time. I have a number of sub-pages I need to add as links from one of the main pages.
On of my main pages is titled 'Agency' and within the agency page I have a number of images which act as links to a number (7) of sub-pages -
I've created the sub-pages on my dashboard with Agency as the parent so the link I get for the first image is ...site-name/agency/2k4kproduction . Here's the code for the links. So far I've only converted two of the links (2k4k and adhoc) -
<div class="twelve columns agencyproducts">
<p>WHAT PRODUCT ARE YOU INTERESTED IN?</p>
<a href="http://localhost:8888/agency/2k4k-production/"><figure>
<img src="http://localhost:8888/wp-content/uploads/2017/07/production.png" alt="Production">
<figcaption>2K / 4K PRODUCTION</figcaption>
</figure></a>
<a href="postproduction.html"><figure>
<img src="http://localhost:8888/wp-content/uploads/2017/07/post-production.png" alt="Post-Production">
<figcaption>POST PRODUCTION</figcaption>
</figure></a>
<a href="2d3danimation.html"><figure>
<img src="http://localhost:8888/wp-content/uploads/2017/07/animation.png" alt="Animation">
<figcaption>2D / 3D ANIMATION</figcaption>
</figure></a>
<a href="http://localhost:8888/agency/adhoc/"><figure>
<img src="http://localhost:8888/wp-content/uploads/2017/07/ADHOC.png" alt="ADHOC">
<figcaption>ADHOC</figcaption>
</figure></a>
<a href="interactive.html"><figure>
<img src="http://localhost:8888/wp-content/uploads/2017/07/interactive.png" alt="Interactive">
<figcaption>INTERACTIVE & PERSONALISED</figcaption>
</figure></a>
<a href="tvadverts.html"><figure>
<img src="http://localhost:8888/wp-content/uploads/2017/07/tv-adverts.png" alt="TV ADVERTS">
<figcaption>TV ADVERTS</figcaption>
</figure></a>
<a href="360video.html"><figure>
<img src="http://localhost:8888/wp-content/uploads/2017/07/360.png" alt="360 Video and VR">
<figcaption>360 VIDEO & VIRTUAL REALITY</figcaption>
</figure></a>
</div>
For my text files I've titled them page-agency-2k4kproduction.php and page-agency-adhoc.php which is what I believed to be the correct naming convention as per the template hierarchy. However, when I click on these links they revert to my home page. I've no idea why this is not working as my agency file/page works fine as page-agency.php so I'm not sure why this will not work. Any assistance appreciated.
I am creating a website that has to be edited on the local server and then uploaded later on the remote server. I'm using absolute path on the local server but then when I upload it to the remote server, links don't work anymore. It seems that I can only use either relative or absolute, not both.
I want the script to work on both local as well as remote server. Local is obviously for editing (sometimes I used to have slow internet connection so I have to use localhost). And Remote for production purposes and client preview.
Below is the function I created:
PHP SCRIPT:
define("LOCALHOST", "/adamsProject");
define("REMOTE_SERVER", "http://adamsproject.ph");
function host(){
if(!LOCALHOST){
echo REMOTE_SERVER;
}else{
echo LOCALHOST;
}
}
EXECUTION ON HTML:
<ul>
<img src=" <?php echo host(); ?> /images/logoMain.png" id="logoMain" >
<li> HOME </li><li>
SERVICES <i class="fa fa-chevron-down"></i></li><li>
ABOUT US </li><li>
CONTACT US </li><li>
PORTFOLIO <i class="fa fa-chevron-down"></i> </li>
</ul>
Like DeDee said, You probably want to remove the echos in the link and also the spaces right after the 'host(); ?>' See the code below. Also, no need for the PHP function; you can use "$_SERVER['SERVER_NAME']" that grabs the current web server name. I hope this helps.
if(!$_SERVER['SERVER_NAME']='localhost'){
$domain = '/adamsProject';
} else {
$domain = 'http://www.adamsproject.ph';
}
?>
<ul>
<img src="<?php echo $domain;?>/images/logoMain.png" id="logoMain" >
<li> HOME </li><li>
SERVICES <i class="fa fa-chevron-down"></i></li><li>
ABOUT US </li><li>
CONTACT US </li><li>
PORTFOLIO <i class="fa fa-chevron-down"></i></li>
</ul>
EDIT
Per your comments, if you have a sub directory off of you 'localhost' then you may need a if statement to add your 'adamsProject' directory to your domain when you are on local host. Try that. Let me know.
EDIT2
Replaced remote server domain with your hard coded domain. Also, added $domain to your index.php on home img link and HOME nav link.
Alternatively just use relative URLs... so,
ABOUT US
Will work the same on both remote and local. Rendering the page produces:
http://localhost/underConstruction.php
for me on local.
Try using $ _ SERVER [ ' SERVER_NAME ' ] instead of your function. It will work both for local server and remote one. Your code should look like this.
<ul>
<img src="<?php echo 'http://' . $_SERVER['SERVER_NAME'];?>/images/logoMain.png" id="logoMain" >
<li> HOME </li><li>
SERVICES <i class="fa fa-chevron-down"></i></li><li>
ABOUT US </li><li>
CONTACT US </li><li>
PORTFOLIO <i class="fa fa-chevron-down"></i> </li></ul>
It will return http://localhost/something or http://yourwebsite.pl/something
You have to add http:// before using <?php echo $_SERVER['SERVER_NAME'];?>. If you won't it will treat is as relative path anyway and will double your server name. In this case it's treated as absolute paths. Here is an example to understand it easier:
Relative path:
<img src="/images/logoMain.png" id="logoMain" >
Still relative path(server name doubled)
HOME
Absolute path (correct one):
ABOUT US
*Remember that <?php echo $_SERVER['SERVER_NAME'];?>return server name without / in the end.
I want to open the audio and video files through the plugin in the wordpress.and i am currently use the plugin wp video lightbox plugin in the wordpress.
I have iframe code like..
<iframe width="325" height="64" src="http://www.ewihosting.com/evp/?id=Mi0wMSBJbnRlcm5ldCBSaWNoZXMgTWFkZSBFYXN5Lm1wMw%3D%3D&profile=default&mode=iframe" frameborder="0" style="background:#fff;" allowfullscreen></iframe>
and i use the logic like..
<li>
<span class="audio_upload_icon"></span><h3>Audio</h3><h4>Lesson #1</h4>
</li>
and i click on the image then open the lightbox but my audio file is not working but may video file is working are correctly.
So please advise me to which plugin very useful for me or any done the code modification.
Thank You.
I am assuming that you are self hosting your Wordpress, or at least you have access to your ftp files in your hosting service. If so, then:
You may wish to save a myvideo.html file in your server, then invoke it via
<li>
<a href="myvideo.html" rel="wp-video-lightbox[iframes]">
<span class="audio_upload_icon"></span>
<h3>Audio</h3>
<h4>Lesson #1</h4>
</a>
</li>
You can include the full path of your local html files, which allow you to make a folder inside of which you can save all your needed iframes, the code will look like this:
<li>
<a href="myvideo.html" rel="wp-video-lightbox[iframes]">
<span class="audio_upload_icon"></span>
<h3>Audio</h3>
<h4>Lesson #1</h4>
</a>
</li>
Lightbox, Shadowbox and other similar tools/plugins will now work. BUT if you are not self-hosting your wordpress nor be able to gain access to the files on your web hosting, you will need a different solution. Please let us know what is the case in order to provide the proper support.
Good luck!
You can use Fancbox Jquery Plugin.
Its pretty simple and usage. For more click here.