I need to display all my post titles in the sidebar of my Wordpress theme all the time. Just now it works only when I am browsing a category (it shows all post titles from that category). But when I click on a post, only this post title remains into my sidebar, which is not supposed to function like that.
Could you help me, please?
Thank you very much in advance!
Hristo
If you are able to write a plugin yourself, which is quite easy using the API of WordPress, you can make yourself a widget that uses the the_loop() function to print out all post titles.
If you have made your own theme, you can even integrate it into your functions.php file and then output the title within your sidebar template.
To query the post from the database you will need the query_posts() function, where you can also filter on some fields of your posts.
Related
I am having an issue finding any way to display a single post on the woocommerce checkout specifically on a payment plugin, I use other shortcodes in these gateways and they work perfectly.
However when I try using some display post shortcodes it doesn’t work at all and instead shows up as text.
Example of my issue - i edit and put in the shortcode [display-posts] and instead of displaying the posts it simply displays [display-posts].
I have tried using multiple shortcode plugins and even tried creating my own. The main one I have tried to use is [display-posts] with the plug-in. I always put it in my themes functions.php as well!
I have tried these short codes on the regular Wordpress pages that I have that are published and have found I have the same issue, so I don’t believe it’s the placement I want the shortcode to appear at. Can anyone help me with this?
To make all the posts display you can create a custom shortcode and the shortcode which you are using is [display-posts] is not default WordPress in build shortcode. To have your same shortcode run please install the below plugin: https://wordpress.org/plugins/display-posts-shortcode/
Then you [display-posts] shortcode will work or another solution is custom shortcode as I mentioned above.
Please let me know if find any issues.
Thanks.
So I am trying to do this and I don't know how. I have a wordpress powered website with a plugin called "frontier-post" in it. This plugin makes a new front-end post submission. The way to use it is to put the shortcode "[frontier-post]" in any post in my wordpress page and that page turns into this.
I want to make a custom page for myself, where I can have the content created by this plugin there too. So I do not want it to be a post in my wordpress, but lets say at a corner in the custom page. I have searched and found these but the suggestions there would not work. I am able to include the wordpress so that the custom page has access to posts, etc. but even using this
echo do_shortcode('[frontier-post]');
would not help me. (even if header is included)
These are the similar things i found:
Wordpress/PHP - How to use plugins outside wordpress-powered pages?
Need Help for my Custom Page Template
I would really appreciate it if you could help me with this.
If you are creating a PHP page that isn't going to be rendered inside WordPress, you can't use a Plugin of the WordPress engine to accomplish what you are wanting to build. (As the accepted answer to one of the pages you link to indicates).
Instead, you might be able to use the json-api plugin and have your custom page query it for the data. While it won't render the shortcode, it will give you the raw data to work with.
http://wordpress.org/plugins/json-api/
Edit:
Based on a comment, your do_shortcode should work...just try it without the square brackets.
I am designing a WordPress theme and would like to post recipes. The text (ingredients, etc.) will go into the main post window, but I would like to include a picture, which should become the background picture of the whole window. The usual Upload/Insert includes the picture into the post. Is there any better way of associating a picture to a post? Should I use the Custom Fields for this?
To make your life easy i recommend a plugin for that The Advanced custom fields
Its very easy to use. You can get full documentation here
This plugin always save my development time.
Hope it will help
Check out WP-Alchemy.
http://www.farinspace.com/wpalchemy-metabox/
It's incredible. It can be implemented into a plugin, or a theme. I have used it and it works great!
Otherwise, the term you are looking for is "Wordpress Custom Meta Box" throw that in google, and you will get more info than you probably wanted.
If you are more of a wordpress codex junkie, check out the add_meta_box function.
http://codex.wordpress.org/Function_Reference/add_meta_box
I'm developing a theme for wordpress and would like to know the best way to show highlights on the home page.
Examples:
I thought two ways:
Custom post types -a custom post "highlight" with metabox for image, text and link.
Theme Options - a page with options for each box.
What is the right way?
Neither. What you want can be achieved using either Wordpress' core functions and/or Custom Fields. Consider using Custom Meta Boxes if you have a client that requires a more intuitive setup, or installing something like the Types Plugin to do it for you.
This will allow you to attach your own variables to given Posts/Pages.
To gain access to a post's Custom Fields, click the Screen Options button at the top of the Post Editor to enable Custom Fields.
Personally, I would Enable Support for Thumbnails for your Highlights image, use The Excerpt for your Highlight copy, and use either The Title or a Custom Field for the heading.
This way, you can keep all your eggs in one basket rather than overcomplicating things with Custom Post Types or Theme Options Pages.
Look at the Plugin "Ether Content Builder"
You could use either of the methods you've suggested. In my opinion getting involved with lots of meta boxes on one specific page template for this is a total waste of time - there is only an image, a header and an excerpt linking to a post/page. Three posts (whether custom or not) will handle that with featured image, excerpt and the page/post title.
I also think doing a Custom Post type is too much just for three posts on the homepage. If you go the posts route just create a new post category called Home Highlights and put your three posts in there, pull them in via a custom loop built on WP_Query.
Yes you can go the Theme Options route too. If it's the client updating the site then it can look quite professional this way, I've started using a plugin called Options Tree after it came integrated with Super Skeleton, it makes it very easy to build your custom theme options which work just as well too.
A matter of opinion really, rather than a hard and fast 'this one is definitely better'!
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