Limit pagination in wordpress to a post published in certain period - wordpress

I'm working on a latest version of wp.
I need this kind of functionality but not sure how to do it.
I want to post an blog article which will be available on its main category listing page for set period (from published from & to date - to date is the last date until when it will accessible on category page using pagination. But after to date this will not be list in category using pagination. But still stays on given url and accessible by direct url for SEO reason.
Basically I want to make a pagination to be valid for only a post published under certain period.
Both cases are fine, do you know any plugin which can be used or need to customize?

I don't know about a plugin, but you can simply customize your wp_query: http://codex.wordpress.org/Class_Reference/WP_Query#Time_Parameters, and make sure you use the "paged" parameter described here: http://codex.wordpress.org/Class_Reference/WP_Query#Pagination_Parameters

Related

Wordpress post view format for filter grid

I am a complete newb to wordpress. I am trying to help a friend out. She asked me to help her move her wordpress instance to another hosting provider.
I have done that for the most part. My issue is the original provider implemented a not-so-obvious way of an isotope filter on some UI elements.
Specifically the object is a company. Each company has a logo, the name of the company, a short description and a contact name / email.
These companies service states / areas and the idea behind the page is to select the state and only the companies for that state are visible.
From the brief searching I have done - there seems to be an overwhelming amount of plugins to support this.
I have tried creating a simple post with a featured image and adding in the text in the excerpt.
My problem is the links. I don't want the links to go back to the post - rather I want the links to go to a custom URL.
Is there a plugin that will allow me to define a custom post type (to include categories) and then filter on it similar to Isotope type of filtering?
There are many free plugins but if you are using the Elementor page builder. I am not advertising my product but as I saw your requirement matches a plugin that I am selling in the market.
The frontend filtering feature is not yet available to the released version but will be released soon. It basically allows you to build a custom grid as you like.
Is it something similar?
https://demo.geekygreenowl.com/elementor-387/
You have to create a custom post, there should be a custom field(custom URL) as well.
Or, You may create a WordPress query. https://developer.wordpress.org/reference/classes/wp_query/
also, coding will be required for filtering

NextScripts SNAP : not using the permalink in wordpress?

This is in a way a followup of this question : Jetpack Publicize: Sharing only on Twitter for a category
I am currently working on a website in which one of the category only serves as a way to curate news on the net and then, share it on the front page and on Twitter.
The post itself is empty, I use a custom field to receive the URL from the user, grab a few things from the target website, update the permalink and save. Upon saving, SNAP publishes the post on Twitter.
My issue is that it is not using the permalink but the url of the post itself (which is absolutely empty). Having a look into the plugin's code, I saw that it was using post metas (most notably urlToUse, snap_MYURL) but couldn't determine if it was a priority issue or something else.
I also try to adjust my code to set these meta values to the url I want, to no avail.
Is there a way I could set my custom functions or the SNAP plugin so that the permalink is used ?
No answer after a week, neither here nor from SNAP's support. No problem.
The ugly patch I used :
Jetpack Publicize for all the Twitter updates
SNAP for the Facebook ones thanks to their ability of posting based on a specific category
It's bloated and I'd love to understand but, sometime, you have to ship

WP blog posts index URL

I want to use WP for a site that blog is just one aspect of it, and I don't want requests to home_url list blog posts (post_type=post), I want them be to fetched using another URL.
This topic default-archive-url-wordpress suggest two ways:
page_for_posts option
post_type=post URL query parameter
but I have questions
About the first, How a page would be able to loop into the posts, and where I should update this option (which hook)?
For the second, the guy says that using this param, make the wordpress get the archive for the specified post type, but I think posts don't have archive (according to includes/post.php their has_archive is left to default) how should I change this and also I want to use a permalink/pretty link for accessing posts.
Thanks in advance
Go to settings -> reading, and change the front page displays posts settings to front page displays a static page and then select a blog page.
Easy as pie.

Post privacy in Wordpress

Can a post be hidden from home page, archive view, category lists etc. and viewable only if you have a direct link to it? The blog doesn't have registered readers and is open to public so that would be a mean of hiding some posts from public view without using the password protection.
I asked this question in Wordpress section and the idea there was to use conditional code so I'm asking the question here as well to get closer to the code.
If I used conditioning, would I have to input each post's ID separately to PHP file for archive, categories, search and such?
EDIT:
After reading a bit more all over, I had an idea of creating a private category and then use some kind of conditioning so that posts from that category are hidden. According to Codex, certain category can be hidden from, for example front page but I don't know if there's a way to hide it altogether except when you have a direct link.
Creating a "Private" category is a good solution. It is quite possible to hide this category altogether except via direct link. You just have to "block all the exits" with conditional code.
The default WordPress theme displays posts via the Post Loop. See http://codex.wordpress.org/The_Loop, especially the section entitled "Exclude Posts from Some Category". Just find all the places in your theme's PHP files (e.g. index.php) where this loop is used, and add the conditional code. You'd also need to filter your category list and blog archives in the side menu. Don't add filtering in single.php, otherwise the private post won't display on its own page.
You'd probably want to add a similar condition to filter search results so that private posts aren't leaked via the blog's search tool. There may be more "exits" I haven't thought of, but I'll be sure to update as I do. I'm glad to look at specific code if you so desire.
Understanding WordPress' post query and loop really opens up a world of possibilities for customization.
I found the simplest way - just use Simply Exclude Wordpress plugin. It has the option to exclude each post (or tag, for that matter) from front page, archive, search or feed. It works flawlessly. You can still view the posts by using direct links.
(Not actually an answer that includes code but a working solution nonetheless.)

Advertisement Manager - Dynamic Google DFP for WordPress

I am to be soon developing a number of websites with dynamic ad models using Google's DFP service. Ideally I want to develop these websites using WordPress, I was wondering if there was any tips or brilliant plugins to allow me to show generic ad units and specific ad units on different categories, pages and posts in certain categories?
I need a default generic set of advertisments to appear in a few predefined ad slots for example: 2x MPU, 2x Leaderboard etc..
These need to change depending on what category or page you are on. The same ads need to show on posts that come from it's parent category, the same applies for sub-categories and pages with sub-pages.
There seems to be no solution out there! Just simple plugins to stick adsense codes into posts randomly it seems..
There is no Wordpress plugin that allows different custom HTML to appear depending on what category the user is on.
Please refer to http://codex.wordpress.org/Function_Reference/is_category or ask me to make a Wordpress plugin for you.
Best way is 'create custom module/plugins'
This solution is only useful if you are not using category description any where.
you can add you advertisement code in category description, if current category has not ADV code then check in parent category ADV code, continue until root category.
For pages you can use custom field.
Here is a WordPress plugin that may be useful for you: http://wordpress.org/plugins/ad-code-manager/

Resources