I am new into WP Plugin development. I want to make a plugin which adds the facility to use any custom code within editor to render it into something else. For instance if I am referring my Hacker News profie and I am using the code H(HackerNewsID) then after publishing it makes a URL of Hacker News pointing to my profile.
What feature of WP would be best fit for it?
Thanks
You cand try shortcodes http://codex.wordpress.org/Shortcode_API
Related
I have created a pretty simple shortcode that contains html and php and wrapped it between the following code and used the shortcode inside a WordPress post. I went ahead to create custom plugin for which contains the shortcode.
I am having a challenge whereby the Yoast plugin is unable to detect the content of the shortcode. I know the shortcode is working perfectly, it's just that Yoast won't pull the right word count. The shortcode really contains a basic select query that fetches data from the database.
I found an article that mentioned Yoast only detects content that goes into the default WordPress editor and may not detect content from themes and plugins unless the developer adds the functionality. I'm the one doing this even as I learn.
The shortcode template I'm using:
function test_shortcode() {
ob_start();
....
return ob_get_clean();
}
add_shortcode( 'myshortcd', 'test_shortcode' );
Is there some code I need to add to the basic shortcode to get this to work?
Thanks.
This is not something that is super easy to do because it requires tapping in to Yoast's javascript API. Here is the article explaining how to do it:
https://developer.yoast.com/customization/yoast-seo/adding-custom-data-analysis/
Yoast used to have a backend hook for this, but now it's all handled on the frontend.
An alternative approach would be to use a third-party service that scrapes the content as its rendered, which ultimately is going to give you better content analysis anyway. They aren't always cheap services though. Here's one our SEO team uses:
https://www.clearscope.io/
I have created a carousel (not perfect yet - images are not showing but it could work) with custom control icons ("next" "back") with Boostrap:http://homepage160630-v3.bitballoon.com/travel
Being not familiar with PHP, I found it difficult to integrate a CMS like Wordpress into my code, so I am trying to re-create the same site as a Genesis/Studiopress Wordpress site based on the Genesis Sample theme:
http://paulheartfieldphotography.com/home/portraits/
My biggest problem is to create the carousel. I have looked at "Easing Slider" plugin: of course it does not allow to position the control icons or even to create my own.
I wonder what shall I do? try to create the custom carousel by transforming my Bootstrap code into PHP or try to edit the plugin? or something else?
https://en-gb.wordpress.org/plugins/easing-slider/
I think your best option is to get bootstrap shortcode plugin like this one https://wordpress.org/plugins/bootstrap-3-shortcodes/
However there are a bunch of them and you should check what works best for you. The link above is just to visualize.
I am new to using Wordpress as a developer as opposed to just using the dashbord but am struggling to understand a few things and would really appreciate some help.
For a site that does not require a blog - do you just create custom/specific page templates for each page that your site requires?
If so - presumably you code the content directly. But then how does the client edit their website's about page or any other page for example - because doing it through the dashboard isn't going to use the necessary CSS hooks without using classes, id's and HTML?
As a beginner to Wordpress - I can't see that posts are used on sites that don't have a blog, but am I correct or is using posts the way a client can edit content on their site, but just have posts styled to look like normal content?
Or am I wrong in thinking a company (I am starting as an intern at a web dev company that use WordPress) provides the tools or at least configures WordPress to enable the client to change content?
Any help getting me to understand the basic concept and way a developer would create a custom WordPress site would be much appreciated. Thanks in advance.
You can use page.php. In WordPress everyone create at least one custom template type to get wider design for custom pages.
You can refer here for more info.
Use Advanced Custom Fields with page templates. Say you are making an About page, call that template about and select that template in the backend editor. Once you save the page, the acf fields will show up and you can populate the content.
ACF: https://www.advancedcustomfields.com/
Page Templates: https://developer.wordpress.org/themes/template-files-section/page-template-files/page-templates/
I am writing the settings menu for a plugin I am developing and I would like to use the custom input that WordPress uses on the dashboard for page and post content.
The idea is to let the user easily add HTML files to the plugin.
Thanks for any help.
Have you tried with wp_editor?
wp_editor();
http://codex.wordpress.org/Function_Reference/wp_editor
I'm designing a theme for wordpress. I need advice on how I would construct it.
At the bottom of my Frontpage/Home I will put a snippets (a title and a short description of blog post) of what is new in my Blog .
Preview:
Question:
What approach should I use? I can make the bottom page widget ready and will just use widget or will use PHP to pull details in my 'blog' page (I dunno how to do it php, a link would be useful)
what is the proper approach? I'm designing it for a client. My concern is If I would make it widget ready, client would have to install the widget. If I would do it on PHP, (I have no resource and idea in doing that )
Thanks!
You'll need to know some PHP and JavaScript if you want to make a WP theme from scratch. Otherwise I would suggest to modify an existing one.
Here is the theme development help from WP.
You'll have to run a loop, in which you'll retrieve the posts from the database (Wordpress handles that) and show them as needed.
The Loop In Action and
Building Custom Wordpress Themes
Hope that helps