If you ever tried to use an if statement because you wanted to remove an action on a specific page, you would have noticed that it doesn’t work! Why? Because you can’t just start writing if statements in your functions.php file. It has to be tied to an action.
Here’s a simple way to do this with the Genesis Framework.
In my case, I needed one of my post type pages to look a certain way. I could have used is_single but then ALL of my single pages would have been effected!
Here’s what I tried at first:
Everything seemed OK, but it didn’t work??
Well, it was then that I realized in order to use an if statement like this, it has to be in a function. Your functions.php file won’t read this little bit code.
So what action am I supposed to add it to?
The key here is to remember that we’re editing the loop. The post_meta and post_info are all within the loop of the page.
So if we want to manipulate it, we have to add our action to anything that comes before the loop.
Well, being that Genesis is so freaking awesome and has TONS of hooks you can use, I decided to use the one that makes the most sense.
And voilà! Now the remove_action function will only work on the single post type pages!!
Genesis 2.0 Version NEW
Are you using Genesis 2.0? If so, then this is the code you would use.
About the AuthorWhat's UP! This is my site, I write 99% of the articles on here. I'm also the owner of SureFireWebServices.com. I help out a lot of developers and designers getting into the web game. Helping is fun for me, so feel free to ask me any questions! I've made courses and have a membership as well to help get you on your feet!
You Might also like
By Jonathan Perez — 2 years ago
I host a bunch of websites. I love doing it because I’m in control of every aspect that goes on with them. I can monitor server load, I can make edits to my server to install new versions of PHP, or mem_cache, or whatever.
One thing that I’ve been harping on a lot is security. I have a plugin called Ninja Firewall on a few of my sites that monitors any file or DB change.
Now this never happened to me before but last night, around 11:30 (still awake, getting tired) I received 3 emails, back to back.
The first was Email Change, then New User Registration, then WordPress Login.
I know the user of the site personally so I KNOW that this is not normal behavior. Also, the name that was being registered was none other than…. trump (dot) clinton at usa dot com! HAHAHA
So I actually got to stop this hack while it was going on, I felt like a super hero, lol.
So here are some steps that I did to remove the hack, because I’m finally getting good at this 🙂
Step 1 – Clean WordPress
The first thing I did was delete everything except the
wp-contentfolder and the
This makes sure that any core affected files are gone! After I delete them, I unzip a fresh download of WordPress, and upload all the files except for wp-content.
MAKE SURE YOU UPLOAD THE SAME VERSION OF WORDPRESS OR SH*T WILL BREAK.
Now I have a fresh WP install.
Step 2 – Go Into WP-Content
I keep all my builds as simple as possible so I have a pretty good grasp on what should and should not be in my WP-Content folder. A great way to check would be to organize what’s in the WP-Content folder by edit date. Check to see if anything was edited recently, and if it was a file, determine if you actually need that file.
A lot of times, what ends up outside of the plugins or themes folder is backups, caching files, things like that. Verify the plugins on the site to make sure that those files are actually being used. Most of the time, if you delete one of these files and then log into WordPress, you’ll get a warning or error message in your dashboard, so don’t stress too much. Delete what you don’t need.
Step 3 – Remove What You Don’t Use
Give your site a quick audit. If you’re not using the 2015 theme, then remove it. Anything you know for a fact you’re not using, delete it. Plugins are a little trickier but do the date thing again. See what was edited recently and check to see if it’s active on the site. If it’s not, DELETE!
Step 4 – Do A Scan
I like to use the plugin Anti-Malware Security and Brute-Force Firewall. It’s very thorough, and it’s free so you can’t beat it. I don’t like using Sucuri or anything like that because to me, it’s always missing something. I’ve had some great luck with the other plugin though and was able to fix/quarantine hacked files.
Step 5 – Harden Your Install
For this, I will either use the iThemes Security Plugin, or my favorite which is currently SecuPress. Both are free, both will harden your website. Just follow the instructions when you install them and you should be good to go!
BONUS – Track Things
If you want to take an additional step, you can install a file monitor. I use NinjaFirewall (which is how I noticed all the things happening on the site). But you can use whatever you feel comfortable with. There are some site audit plugins out there that will email you when things happen on the website, so feel free to look into any of those.
ALWAYS BACK UP!
The worse case scenario is you can’t fix it. Now what do you do? You can hire someone OR you can restore a clean back up. So make sure you’re sites are always backed up!
If you’re reading this thinking to yourself, “man I don’t want to deal with that crap,” then let us help you out. We don’t offer clean up services, but we do host website which we treat as if they are our own! Send your clients our way for hosting needs, we promise we’ll take care of them! (White Labeled too, so you can take all the credit.)Post Views: 1,440
By Jonathan Perez — 2 years ago
NOTE: GUEST POST 🙂 ENJOY
WordPress is a platform that is extensively used for creating blog websites. But have you ever thought of creating a website based on varied themes like fashion, beauty, lifestyle or any other subject of your choice? I guess you would have. Such a website that publishes content on a specific subject or a topic is termed as an online magazine. Having an online magazine that is fancy along with being sophisticated and contains appealing content will attract traffic to it. So, in this blog, I would be making you aware of the steps or techniques that you must implement in order to create a magazine-style website.
Below mentioned points will act as a perfect guide for you when you are looking to create your own online magazine with WordPress.
Having an Intriguing HomePage
It becomes utmost important to have a homepage that highlights the most popular and the recent stories along with displaying other articles. You must display multiple links and extracts from a selection of articles that you have published on your website. Your visitors must be presented with a few short stories and articles to choose from. Using a feature-rich magazine theme will enable you to build a homepage that has plenty of options which will attract visitors to your website. These themes have predefined homepages that are of different genre. This makes it very easy to choose a homepage for your magazine website and you could even find a homepage that fits in your website’s scenario. This will save a lot of your time which could have been invested a developing a homepage.
Top-Notch User Experience
Your online magazine will only become a success if it is able to generate traffic on it. It is important to keep your visitors as long as possible on your website. You will have to give your visitors such a visual appearance that will prompt them to visit your website again and again. This will enable you to create a long lasting impression on the minds of them. Most of the news websites and magazines display adverts which allow them to get monetized. Thus, the more page impressions that are generated by your visitors, you will be able to earn more money from your advertisers. This will only be possible will users choose your website over the others which searching for a particular content or topic.
Selecting a Magazine Theme
When you are looking to create a magazine website, you will come across quite a few of the magazine themes that are offered by WordPress for free. Some of the popular free WordPress magazine themes include Newspaper, Newsmag, TwentyFouteen and many more. You can even choose some of the premium WordPress themes that will offer you more functionalities and features but they will cost you money. The benefits of choosing an appropriate theme for your magazine website is that it will come preloaded based on some genre like lifestyle, heath and fitness, fashion etc. So, if your magazine content falls in the predefined category this will prove very beneficial for you. This will enable you to easily choose any of the themes based on your magazine requirements.
Creating Content for your Magazine Website
In order to create a successful magazine or news website, you will have to publish content that offers value to your target audience. The content you publish will totally depend on the focus of your website. A growth in the number of articles will have a direct impact on your visitors who will be directed to your website as a result of search engine results. Publishing relevant and informative articles will turn out positive for you. Choosing a content format that is appreciated by your audience will be a good ploy. A high-quality content will enable you to gets leads and also rank higher than the websites that are also showcasing a similar content as yours. Grabbing the attention of users is only possible if you rank higher in the search results of popular search engines like Google, Yahoo and Bing. Google also ranks a quality content much higher than the other contents of the same genre.
Growing Your Target Audience
Once you have got initial visitors on your website you will feel the need to grow your audience. The best approach of doing this is to pay for advertising on the social media platforms like Facebook, Twitter or seek assistance from advertising networks and platforms that are related to your topic. One thing which you must surely do is to set up profiles on the popular social media networks. There are some social media platforms that generate huge traffic on certain topics or subjects. Each and every social media platform has an audience of its own. You should also look for sponsorship opportunities, building partnerships with other people or even apply to guest post on related websites to get a link back to your website. Another important component in building your audience is to adopt a strategy while setting up your email newsletter. Persuading your visitors to sign up for your newsletter is a proven methodology to convert one-time visitors into loyal customers.
I hope that the above-mentioned points throw enough light on the parameter that you need to take care of if you want to create a successful online magazine. It would be great to have your views on this post of mine. Do let me know about them in the comments section below.
Sarah Clarke is working as a professionally qualified WordPress Developer at WordSuccor Ltd., a renowned firm providing WordPress Theme Customization Service at very reasonable cost with a global reach. She loves to share her thoughts on WordPress and always looking for learning something new about it. You can follow her company on various social media sites such as Google+, Facebook, and Twitter.Post Views: 1,691