I am new to WordPress and I am creating a theme from scratch, because I wanted to look exactly as my design. At first, it was pretty straight forward, having the index.php and calling the header and the footer, even the loop is very easy. But, after struggling to find why isn't working, I have finally find a way to display my posts in the blog page. However, I have a problem. I do not have a pagination because I don't know how to do it, and when I add multiple posts the container goes all over the footer and beyond. How am I gonna do it to "push" or scale the footer? Sorry if my question sounds a little weird, any feedback would be great. Thanks
You have two different questions:
How can I create pagnation on my blog page?
How can I prevent the content from going beyond the footer/how can I make the content push to footer to the bottom?
1. You can create pagnation on your blog page with the following two functions: previous_posts_link() and next_posts_link() both of these functions have two parameters, with the first parameter you can set the link text.
Example:
previous_posts_link("« Previous Posts");
//will output a link:
//« Previous Posts
2. Your second question is a bit harder to answer because you're not providing any code, add your CSS to your original question.
take the pagination from the default themes.
best if you don't have a deep understanding of the WordPress codex to take the default templates and design from them. then you have all the code/functions you might need.
Related
Ok, I know that there are several other questions on SO regarding this topic. By now, I have probably read all of them. I have been researching this for a little over two hours now and I am coming to the end of the road (about to give up!)... So, here I am on SO finally asking the question to involve other sharp minds.
I am helping build this Wordpress site: greatman.us. And, the Posts page is located on a page called "Blog." The "active" menu item is highlighting properly on PAGES, but when you go to a POST, the "Blog" menu item is not longer highlighted (i.e. NOTHING is highlighted in the header menu).
There is no way in Wordpress - as far as I'm aware - to create a "parent" for a blog post. This option is only available for Pages. I need to be able to have the "Blog" menu item stay highlighted when I am viewing a BLOG POST.
For a general example:
mywebsite.com/blog/ <--- menu item "Blog" is highlighted
mywebsite.com/blog/post223 <--- menu item "Blog" is no longer highlighted
I am proficient with CSS and HTML, but not with PHP. So, if this is a PHP fix, please dumb your answer down as much as possible.
I have read tons of other articles about this online and it seems to be a common issue, with most people not knowing how to code with PHP.
I am using a custom theme, called Divi. And it is missing some of the CSS elements that other forums and sites I have read said that the style.css should have. This is another reason I am coming to a dead end. Please help!
By the way, one WORKAROUND I discovered is to add POSTS as sub-menu items to the "Blog" page that you made in the Wordpress Menus area (in the admin back-end). Then, use "display:none" is CSS to remove the submenu from being displayed to the public. This causes two main problems, though: 1) You can never have any other sub-menu items, because they won't be displayed. 2) You have to manually add every single blog post to the menu as a sub-menu item. This will eventually make your menu super long assuming you are a regular blogger. It is also a hassle.
Within your CSS, you will also need to add .current-page-ancestor with the same attribtues as your current menu item.
Something similar to below:
.current_page_item, .current-page-ancestor {
// Some attributes
}
This is guessing that you have use wp_nav_menu() though. If not then I'll need to see what code you have used to generate the menus.
I have never used wordpress as a cms for a site so please forgive my obliviousness. I tried to google this for a bit with no luck, I think I am either phrasing this wrong or thinking about it incorrectly.
I have page on wordpress that I would like to feed in a bunch of "news" posts. Can I code this within the actual page (like the text input section). How would I go about doing this. Is it possible to have a plugin or some shorthand code that would feed in all the posts with a certain category, and further more is this possible to do within just the general page editor (just within the wp-admin panel). Again, sorry for my obliviousness, I feel like this is probably a pretty simple answer, but I haven't worked on wordpress in years.
Thank you for your time!! Any points to the right direction would be incredibly helpful.
You can try:
[display-posts tag="advanced" posts_per_page="20"]
This will list the 20 most recent posts with the tag ‘Advanced’.
For more options, check this: http://en.support.wordpress.com/display-posts-shortcode/
I'm in the process of trying to create a custom theme for Wordpress and managed to create a working widget area. But for the purpose of this theme, I would like to allow only one "Text-Widget" to be used. How would I go about limiting this?
Be specific about what you want to ask. Wordpress don't limit widgets you can use as much text widget.
Can you provide urls so we could advice a solution to you?
I'll update the code below to be compatible with your theme if you can give a url to your blog.
WordPress don't allow you to limit the number of widgets but you can use javascript to hide the next sidebar items.
$('.sidebar li:gt(0)').hide();
the 2nd list item onwards will be hidden.
and yeah, this is a bit of cheating though.
SEO wise the next widgets are still visible.
I wanted to create a horizontal based wp theme.
Something like this one (http://www.lena-meyer-landrut.de)
What would be the best starting point to do that?
Every menuitem(category) is a single post? A custom field? a page? Something else?
Thanks for your help.
If the content doesn't change too often, you can use pages.
But with that theme you would have to write multiple wordpress loops, this code can get quite messy.
Create a loop for each "page" that shows up on the page.
Another way...you could hard-code the design + jQuery sliding.
Then for the plain content sections you could create multiple "sidebars" and put a sidebar where each content part is...the user could then edit their own content with a text widget.
http://www.quickonlinetips.com/archives/2007/11/how-to-create-multiple-dynamic-sidebars-for-wordpress-widgets/
Custom posts are okay, but if you are writing more than 1 custom post per page/post, then it can get quite cluttered...
I think the best option for you would be to build your site based off one of the frameworks of an existing horizontal theme...
Here is the best information I found:
http://wordpress.org/support/topic/horizontal-way-for-wordpress?replies=13
Direct link to the old "horizontal way" theme for wordpress:
http://www.thehorizontalway.com/download/THW_template_0.6.zip
Here is another base theme to base your site off of:
http://wordpress.org/extend/themes/wplatformer
I'm having trouble with modifying the way comments are displayed.
Currently they are always displayed as "Comments (%)". Changing the code that's displaying the comments to doesn't seem to do anything.
Where can I properly change the way # of comments are displayed?
I'm using the primepress theme - http://www.techtrot.com/primepress/
Blog link - http://stringo0.teamjl.net
My goal is adding a comment bubble displaying the number of comments - any easier way to do this is appreciated as well!
Everything you need to know about what's available in showing comment meta: Template Tags/comments popup link « WordPress Codex
Not familiar with that particular theme, but in some there are multiple references to the comment functions, depending on the context (eg display single post, multiple posts, search results, page, etc). So check all the php files for references to the comment functions.
I'm not sure why, but the comments_number and related popup function didn't work for me. I think it's because of some filters interfering, not sure which ones - could be the intense debate commenting plugin, because I noticed that it redirects to a different anchor (#idc...).
I ended up using another function, called get_comments_number which I found by looking into the wp source code.