Tagged Questions
-1
votes
2answers
32 views
Why don't some template tags work when querying information on single.php?
I'm trying to fetch content about the current post into the header.php of my theme (to dynamically insert Facebook OpenGraph Metadata).
Since I'm on a single post page, shouldn't it be able to run ...
0
votes
2answers
59 views
Strip <p> from <blockquote> or something better?
Looking for some help on something that has me really contemplating not using blockquotes for the moment!
I have this code:
<?php
$show_after_p = 1; $content = apply_filters( 'the_content', ...
1
vote
2answers
35 views
2 Loops, Only Displaying 1 Loop in Both Loops
I have 2 loops, movie trailers and gaming trailers but gaming trailers is displaying under both Movie Trailers and Gaming Trailer. Each loop displays the post tagged with either Movie Trailer or ...
0
votes
2answers
59 views
Getting rid of the blog page entirely
My goal is to not use a separate blog page but end up with a structure like this...
http://domain.tld/page/comments/
I believe I can do this with the Cornerstone plugin ~ [ ...
0
votes
1answer
109 views
The_excerpt() doesn't parse <!--more--> - how to change that?
I'm using the_excerpt(); in blog.php file (post listing page) and it doesn't recognize <!--more--> if "Excerpt" field is empty and it grabs the beginning of the content as excerpt.
This issue ...
4
votes
2answers
430 views
Build a content and excerpt grid loop with paging and options for # of posts
What I'd like to do: on index.php, a loop that shows a selectable number of full posts using the_content and then below that shows a selectable number (the number of posts can be hardcoded in the ...
1
vote
2answers
99 views
Having a Function Inside of the Loop
I am trying to make a frontend product editor for WooCommerce, and have a loop that returns all of the products for the current user. I am trying to use gravity forms as the editor, so a single ...
1
vote
1answer
80 views
Function to show only first instance of shortcode
I need to add a function to my theme to remove additional instances of a shortcode in a post.
First off I wonder if i'm approaching this wrong, but I have a theme that is drastically reformats the ...
0
votes
2answers
60 views
Way of getting queried loop before the query with a filter hook?
Is there a way to get the results of a loop with a filter before the code for the loop is performed in the structure of your code?
My markup is something like this:
<body>
<div>
/* ...
3
votes
2answers
825 views
How to display the_post_thumbnail if a post has one or otherwise display the first image in a post?
I would like to create a condition that checks to see if a post has a thumbail and if it does display it, otherwise display the first image in a post.
I tried something like this in my loop.php but ...
0
votes
2answers
181 views
How to only publish posts with image in it
I use a standard loop in my index.php and that shows all the posts beeing posted. What i'm looking for is a code that only shows the posts that have image(s) in it.
With other words: i only want to ...
1
vote
2answers
155 views
How to speed up a wordpress function with multiple loops?
I am a PHP novice and wrote this function. It is an alphabetical navigation which shows only the letter that have posts in both that letter and the currently filtered "genero" taxonomy term.
I use ...
0
votes
2answers
574 views
Best way to style first post differently?
I am building a custom (child) theme and I want to style the first post of my loop in a different way than the others (bigger image, different position of some stuff).
Which is the best way of doing ...
0
votes
1answer
74 views
Post variables not displaying correctly in custom function
There seems to be something wrong with the simple function below, but I can't figure out what it is. It is displaying as the following and I can't figure out why. I know it has something to do with ...
1
vote
2answers
678 views
Manually set global $post vars with an ID, in order to use template tags
I have a function retrieving ID's of posts by very specific means.
I need to be able to set the global $post in order to use functions like the_content(), which does not allow an ID as a parameter.
...
0
votes
1answer
1k views
Simplest Way to Build Custom Archives Page?
I am looking to create a page in Wordpress to output links to all of our posts from every month since we launched the blog. I have seen the archive.php template file in Wordpress, but this seems to ...
1
vote
1answer
135 views
Help with Wordpress Query
I'm sort of a noob when it comes to Wordpess; I've only recently started building themes and I've run into a wall. I'm trying to feature 3 different articles at the top of my site using wpquery and ...
1
vote
1answer
545 views
Custom excerpt function re-factoring
This may be more of a php best practices question, but here goes...
I am using a custom excerpt trim function:
function new_wp_trim_excerpt($text) { // Fakes an excerpt if needed
global $post;
...
0
votes
1answer
716 views
How do I pull excerpts from pages?
So I enabled custom excerpts on my pages with this function.
add_action('init', 'page_excerpts');
function page_excerpts() {
add_post_type_support( 'page', 'excerpt' );
}
However, When I enter ...
1
vote
1answer
224 views
Show css depending on activity type in BuddyPress activity-loop
I was wondering if anyone knew of a way to show specific styles to the activity loop depending on the activity type?
This is what I had an idea of:
function mycustom_act_type() {
if ...
0
votes
2answers
3k views
How would I create a shortcode to display a custom post within a page or regular post?
I would like to create a shortcode that will extract information for a custom post, and display it within a Page or regular Post.
Specific use case: I have a custom post type "Film" for a film ...
0
votes
1answer
285 views
Output loop to function return?
I'm working on a shortcode function that returns a category image, a link to the category, the last three posts in that category, and another link to the category. See my code below:
...