Get post id from widget in sidebar - wordpress

I have a sidebar (test-sidebar) that contains widgets with custom posts.
How can I can get posts from sidebar (widgets)?
I don`t want render post only get their IDs
I am using WordPress Version 4.9.6

In short, you can't with the built in WordPress widgets.
You will need to create your own widget using the WordPress Widget API. From there you will be able to develop a widget to complete whatever task you want. Otherwise it will be a trip to the WordPress plugin repo to see is someone is sharing a plugin doing what you want to do.
On a side note, you may also want to look at building a custom WP Query. This will allow you to pull in whatever posts you want and then manipulate them however, within the body of the page.

Related

Is there a way to pull custom fields created in Pods plugin into a Elementor posts widget

I'm pretty new to WordPress but have been experimenting with the Pods plugin for custom post types and fields and trying to implement them using the Elementor page builder. Creating the post type and fields is all straight forward but I'd like to be able to now implement these custom fields into my pages. Specifically, I'd like to be able to integrate them with the Posts widget in Elementor.
By using the Ele Custom Theme plugin I have been able to create a Loop template and setup the articles I'd like to loop through and this method works fine using the standard Posts widget in Elementor. However, the standard Posts widget does not have the ability to add a filter to your items. This is what I need.
There is a Ultimate Addons version of the Posts widget that incorporates this filter function but it doesn't seem to have a feature to loop through a loop template. In the standard Posts widget, you are able to select a 'Custom' skin which can then hook up with the loop template you've created. The Ultimate Add Ons version doesn't have this option.
I hope I'm explaining this correctly and that someone maybe able to offer some advice.
Is it possible to for the Ultimate Addons version of the Posts widget to pull through a custom template like the standard version does. I have added an image as a guide. The Ultimate addons version is on the left hand side.
Any advice on this would be much appreciated
you can use Livemesh Addons for Elementor,
https://wordpress.org/plugins/addons-for-elementor
with that you can create and select custom templates for post and custom post types.

Best location for a query, or shortcode generator on the Wordpress dashboard?

I'm still new to Wordpress, so I'm still not sure if this is possible.
I made a widget with a bunch of different options, and I also made a shortcode that can create said widget. I also added a shortcode generator to the widget editing page but this is too impractical since it forces people to create a widget, save the widget to generate the shortcode, copy the shortcode, and then delete the original widget.
What I want is to create a page somewhere in the Wordpress dashboard, where administrators can easily create a shortcode using a Javascript app. I assume that this is already a thing.
Any advice would be much appreciated.

How to create a public custom WordPress widget

I want to create a widget for WordPress that anybody can use (for free) which contains some entertaining content (like a gadget for iGoogle in earlier times).
What I did not find out:
Can a (custom) widget be public/listed, so everybody using WordPress can see and use it?
Or do I need to create a plugin in order for other WordPress users to see and use it?
Since I want to let the users decide, where to put this additional content, how can I achieve this? (i.e. integrate this widget behaviour into a WordPress plugin?)
The basic idea is that we have some interesting content, we want to spread on WordPress for free.
It's up to you wether you want to create you widget through you theme (eg: via functions.php) or via a plugin. If you would like everyone to use it independently from a theme, then the best idea would be to do it through a plugin.
Here is a simple tutorial that explains the pieces of code you need to include either in your theme or in a new plugin to create a Widget accessible via the WordPress's widgets panel: http://www.wpbeginner.com/wp-tutorials/how-to-create-a-custom-wordpress-widget

Is it possible to somehow add data specific to an individual page's widget in Wordpress?

I want to add a google maps widget to Pages on a Wordpress site. They all have the same Template with a Sidebar but the map will be unique for each. I feel like there should be a way to populate the widget from the edit page screen for that Page. Does each Page actually need it's own Template?
This seems limiting maybe I'm missing something. If the question is unclear I let me know but I think this should be something ppl have run up against before.
I would suggest the integration of a wordpress plugin to accomplish this. It will be fairly easy to do.
If you want to do this without purchasing any 'pro' versions of a plugin and don't mind writing some simple code, then I would suggest Simple Google Map. You will have to insert a shortcode into the widgetized sidebar area. Here is the plugin link - http://wordpress.org/extend/plugins/simple-google-map/
In order to customize each page's sidebar area, You need to write some code. Please refer to this article which will explain how http://www.wpbeginner.com/wp-themes/display-different-sidebar-for-each-post-and-page-for-wordpress/
It involves a simple alteration of your 'single.php' file and the usage of 'custom fields' so that you will be able to do this from the edit screen of the page, just like you wanted to do!
Use a plain text widget for each map and Widget Logic to select the page it appears on: WordPress › Widget Logic « WordPress Plugins

Content Blocks in Wordpress

Is it possible to create small blocks of editable content on certain pages of a wordpress install?
I am thinking along the lines of little boxes that contain specific information that can be edited through the admin dashboard.
I'm sure it's possible, but you'd probably have to look in to the WordPress plugin API to hook in to the proper places and save it to the DB. Also check out jQuery's inlne editor plugin.

Resources