Social Sharing Buttons Not Working in custom WordPress theme - php

I have of late been developing a custom WordPress theme for my own blog from the ground up! Most is not finished but my social sharing buttons are not working at all!
I have been using this tutorial....
http://www.jqueryscript.net/social-media/jQuery-Plugin-To-Customize-Social-Share-Buttons-Counters-SocialShare.html
and gone over all of my code with a fine tooth comb! I even tested it on a testing page and it's working fine there so i have no idea why it's not working on the actual theme!
I got a feeling it has something to do with my functions.php page as none of my widgets work in my sidebar which i have overcome by adding the custom code there! So i probably have to add some more code to my functions!
Also just to let you know eack of the buttons and their counters are contained within a div I made just below the_content and above the comments_template on my single.php
I am also running WordPress Version 3.9.1 if that helps
Any help would be greatly appreciated!
Phillip Dews

Without any examples, fiddles or code samples, it is impossible to assist. Having had a fair bit of experience with WP, this will be very difficult to help you with, unless you can provide a live site to look at. Even then, may be challengin' :)
Looking at that page you linked, your problem is almost certainly php-based, not jQuery. If your functions don't work and you're adding php code directly to your sidebars, then yeah, absolutely php.
A couple of things I can think of though that are commonly problematic:
Check/test/debug your functions.php file by itself. Make SURE it's rock solid.
If you're developing heavily, setup XDEBUG. Invaluable!
If you're mostly themeing, check out the debugbar plugin.
Of course, you'll always want to make sure you're using the template hierarchy correctly (http://wphierarchy.com/). Double check every path you use, specifically the differences between paths to load stuff from themes -vs- child themes:
http://codex.wordpress.org/Child_Themes
http://codex.wordpress.org/Function_Reference/get_template_directory_uri
http://codex.wordpress.org/Function_Reference/get_stylesheet_directory_uri).
Oh yeah: functions.php in child themes loads in addition to the parent's functions.php, it does not replace it.
Hopefully something in here helps.

Related

Using MediaElement.JS in WordPress

So I have what I think for most of you, is a stupid question, but I can not figure this out by myself. I'm building a WordPress theme for a friend of mine, and I need to build a custom looking audio player. I think, that MediaElementJS is a good place to start.
In my understanding, MediaElementJS is part of the core features of WordPress, and I have added it in my functions.php with the code
function my_scripts() {
wp_enqueue_script( 'wp-mediaelement' );
}
add_action( 'wp_enqueue_scripts', 'my_scripts' );
But still, the normal browser player is showing in all the browsers. I have read a lot of topics here on StackOverflow and over the internet, but I just can't figure out where it goes wrong. Since it's part of the WordPress core I don't need to install the plugin that is also available right? Also I tried installing it, but it then also shows it as the basic browser player.
Is their someone here, that can teach me how I implement MediaElementJS properly in my theme? I think I can figure out the styling part out, but the installing of the MEJS, I don't know where to begin nor look for good instructions that are really going to help. It seems inpossible to find a good tutorial on this :(
I really hope someone can help me out with this.
Thanks in advance!
(since I'm working locally I don't have my site running somewhere, if
needed, I can host it somewhere!)

How to make a blog type page with prev & next page functionality?

I was wondering if I needed to learn javascript and or php to make a site that can move content from page to page as new content is added (like a blog). I was thinking of using wordpress and wipe the design and write my own css, but seems you need to do a $30 update to have access to css.
Is there a free site (like wordpress) that could help me out with the php part or whatever is needed to have this kind of functionality? How many hours would it take to learn php to get the 'blog' running correctly if I only know html/css right now, with a bit of javascript and can manage jquery plugins.
Thanks alot for any answers.
If I recall correctly, WordPress is entirely free and fully customization per your liking - no charge.
PHP would be your answer to do this, and Javascript would only help compliment the transitioning. If you've never tinkered with PHP or any other software programming language, you will spend months perfecting this. It's a whole other ball game.
But like I said, WordPress is entirely free and modifying the CSS is as well. I've never heard of a $30 charge to change WordPress CSS file.
You're talking about upgrading a WordPress.com site where they host it for you and strictly control what you can do.
You want to go to WordPress.org - it's free and you can do whatever you like - but you do need to sort out your own hosting.

Joomla - Multiple Layouts in one template file

I am starting to build a website in Joomla 1.6. The website is going to primarily have two layouts. One for the homepage and the other is for all the other sub-pages.
The catch: I am wanting to put both the layouts in one template (or folder).
I have seen this done before by using a conditional statement with the JURI:current() function, but for some odd reason, it is not working properly for me.
Here is some basic psuedocode to indicate what I am trying to do...
<?php
$HomePagePath = 'Homepage URL here...';
echo JURI::current(); // Just to test what the current output is going to be.
?>
<?php if(JURI::current() == $HomePagePath ): ?>
Template for homepage here
<? else; ?>
Template for sub-pages here
<? endif; ?>
When I test what I am building with this code, it is not working properly. I have ensured several times that the output from the current JURI matches the current URL in the browser. It is showing me the sub-page content rather than the homepage content... I am not sure what is causing this :/ ...
I am currently running this website without a real domain behind it. I am using the GoDaddy Preview DNS feature for the time being... This feature basically gives me a temporary domain until I point the appropriate one. I do not know if this could have something to do with the current JURI not parsing properly? This is the only thing I can think of that would be causing this...
I guess my next question is... do you know another method, other than the current() function, that will accomplish what I am trying to do?
Thanks!
Chris
You can use template Styles to help in this process.
You can duplicate styles, and change things about the style - but each style will use the same 'template'.
I've played around with it a bit and I think it's probably pretty close to exactly what you're looking to do - unless you wanted a completely separate look for the 2nd template in which case using 2 templates will probably be the 'best bet'.
I'd recommend looking into template styles though - essentially you could have as many 'styles' of the template as you want, but everything is based off of that one 'template', it's only the style that's changing. You can go into your menu items and select that style from the dropdown for templates. I hope that helps to make sense, because it sounds like exactly what you're looking for.
Also, I'd recommend following the upgrade to 1.7 before you get too far along in development. Both for security reasons, and to make sure your template items work smoothly with 1.7 (they're pretty similar, but I've had some templates that didn't enjoy the jump from 1.6 -> 1.7).
*edit: here is a little information on it: Joomla Styles

Beginning to use wordpress, custom theme?

I'm pretty new to wordpress (only a couple of days), but I have it up and running on my website with the default theme. First of all I would like to change this theme. I have found a tutorial directly from wordpress but it is extremely vague: http://codex.wordpress.org/Theme_Development. I'd like to have a totally different layout for my website though, with only one page being replaced daily with a different article - a new article everyday basically. But I don't know where to start. I want to first create the theme though, I think that will put things in to perspective. How do I do so? I know the principles of php and enough about html and css to create whole websites. Thank you
That link should tell you everything you need to know. You basically just edit the theme files to get the layout that you want. The best way to learn truly is to experiment. If you have a specific question I could help you with that, but to tell everything involved in creating a custom theme would go way beyond the scope of an answer for this site.

PHP wordpress style related posts

Do you know how wordpress decides which related posts to show?I mean I know if it has tags, then it's easy but if it doesn't?
Best Regards,
Generally the 'related post' function of a Wordpress Blog is created by the owner of the blog, or using a plugin. I can imagine that those plugins either look for new posts with similar tags or in the same category as the post it is displaying.
As far as my knowledge extends, I do not believe that Wordpress has a show_related_posts function, although I may be wrong. If it does, it would be simple enough to look it up on the documentation at wordpress.org.
Also, another good part about OpenSource programming is that you can simply go in and look at any of the code that you are curious about. I personally use Notepad++, and when I find a function in Wordpress or any other CMS I am not famillar with, I simply copy and paste the function name, and do a Multi-File search on the function to figure out where it is declared.
I'm going to have to go with Chacha102, as far as I know this can only be done using plugins or by hacking the code yourself.
I did something similar by falling back on the post's category if it had no tags, works pretty well too.
This guy has the leading plugin for related posts. I'd download that and take a peek at his code and see how he does it. Then you can reverse engineer it and make it your own. The beauty of opensource.
http://wordpress.org/extend/plugins/wordpress-23-related-posts-plugin/

Categories