0
votes
1answer
30 views

relation OR instead of AND - Filtered term ID's in loop

Question not related anymore.. First I tought about the relation OR/ AND for results, but I believe I should work with 'operator' => 'NOT IN'. I would like to query the results that meet multiple ...
0
votes
1answer
30 views

Breaking up multiple words and inserting an image after first word

I'm not sure if it's possible, however, what I'm after is to break up WordPress titles that are multiple words and then insert an image. My current loop works just fine. Right now it gets the page's ...
0
votes
2answers
121 views

Filtering posts by category name based on page's slug

I've created a page template and the goal is to create a loop that gets all posts by category name. The category name is passed from the slug of the page name. I haven't been able to get this to work ...
0
votes
3answers
233 views

How can I loop into two different DIVS without repeating the DIVs

I am having a little trouble trying to figure out how I can accomplish this: I have a container with two colums in it, a right and a left column. Each column will have 3 posts with a short excerpt ...
0
votes
1answer
19 views

Pagenav Not appearing on custom Template

I've just finished building a custom page template using the following code. The issue is the pagenav doesn't work - But works on every other page with multiple posts. I want this one to appear if ...
0
votes
0answers
30 views

the_content() function in loop-single.php

i need to show to different layout based on featured_image size for that how on can the_content() as per that. if featured_image .size =={ the layout would A } else{ the layout would B } how does on ...
0
votes
0answers
29 views

How to combine Custom Post Type Pagination with $selected_id?

I have a Videos CPT, everything is set up nicely, but I wanted to add pagination. Loop begins here// $args = array( 'post_type' => 'videos', 'posts_per_page' => 10 ...
-1
votes
1answer
151 views

Options.php loop won't show!

I'm creating an options panel for a theme on my localhost that's stored within the options.php file. My options panel will have two main loops. The first is to list the different sections and the ...
-1
votes
2answers
72 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
176 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
48 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
98 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
184 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
632 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
163 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
146 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
67 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
1k 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
271 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
208 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
741 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
78 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 ...
2
votes
2answers
1k 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
146 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
631 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
807 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
280 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
5k 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
323 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: ...