Change related blog section

This commit is contained in:
Markus Ankenbrand 2016-09-11 16:28:51 +02:00
parent cb567117fe
commit b27fecc534
3 changed files with 203 additions and 50 deletions

206
.idea/workspace.xml generated
View file

@ -3,6 +3,7 @@
<component name="ChangeListManager">
<list default="true" id="f4814905-d0bb-4804-a501-969ee4335bd0" name="Default" comment="">
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/functions.php" afterPath="$PROJECT_DIR$/functions.php" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/single.php" afterPath="$PROJECT_DIR$/single.php" />
</list>
<ignored path="atravelblog.iws" />
@ -23,26 +24,42 @@
<favorites_list name="atravelblog" />
</component>
<component name="FileEditorManager">
<leaf>
<leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
<file leaf-file-name="single.php" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/single.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="316">
<caret line="99" column="109" selection-start-line="99" selection-start-column="109" selection-end-line="99" selection-end-column="109" />
<state relative-caret-position="661">
<caret line="165" column="37" selection-start-line="165" selection-start-column="37" selection-end-line="165" selection-end-column="37" />
<folding>
<element signature="n#style#0;n#div#0;n#div#3;n#div#3;n#div#0;n#div#0;n#div#0;n#!!top" expanded="true" />
<marker date="1473535928504" expanded="true" signature="3243:3283" ph="..." />
<marker date="1473535928504" expanded="true" signature="3476:3566" ph="..." />
<marker date="1473535928504" expanded="true" signature="3548:3566" ph="..." />
<marker date="1473535928504" expanded="true" signature="3706:3730" ph="..." />
<marker date="1473535928504" expanded="true" signature="4036:4273" ph="..." />
<marker date="1473535928504" expanded="true" signature="4247:4273" ph="..." />
<marker date="1473535928504" expanded="true" signature="4659:4730" ph="..." />
<marker date="1473604097167" expanded="true" signature="2810:2850" ph="..." />
</folding>
</state>
</provider>
</entry>
</file>
<file leaf-file-name="functions.php" pinned="false" current-in-tab="false">
<entry file="file://$USER_HOME$/wordpress/wp-content/themes/hitchcock/functions.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="121">
<caret line="229" column="21" selection-start-line="229" selection-start-column="21" selection-end-line="229" selection-end-column="21" />
<folding>
<marker date="1466243448000" expanded="true" signature="3970:4060" ph="..." />
<marker date="1466243448000" expanded="true" signature="4012:4051" ph="{...}" />
</folding>
</state>
</provider>
</entry>
</file>
<file leaf-file-name="functions.php" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/functions.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="705">
<caret line="47" column="0" selection-start-line="47" selection-start-column="0" selection-end-line="47" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
</file>
</leaf>
</component>
<component name="Git.Settings">
@ -52,6 +69,7 @@
<option name="CHANGED_PATHS">
<list>
<option value="$PROJECT_DIR$/single-Urlaub.php" />
<option value="$PROJECT_DIR$/functions.php" />
<option value="$PROJECT_DIR$/single.php" />
</list>
</option>
@ -62,6 +80,9 @@
<detection-done>true</detection-done>
<sorting>DEFINITION_ORDER</sorting>
</component>
<component name="PhpServers">
<servers />
</component>
<component name="PhpWorkspaceProjectConfiguration" backward_compatibility_performed="true">
<include_path>
<path value="$USER_HOME$/wordpress" />
@ -96,6 +117,7 @@
<foldersAlwaysOnTop value="true" />
</navigator>
<panes>
<pane id="Scope" />
<pane id="ProjectPane">
<subPane>
<PATH>
@ -103,6 +125,96 @@
<option name="myItemId" value="atravelblog" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="External Libraries" />
<option name="myItemType" value="com.jetbrains.php.config.PhpExternalLibrariesNodePatcher$PatchedExternalLibrariesNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="PHP" />
<option name="myItemType" value="com.jetbrains.php.config.PhpExternalLibrariesNodePatcher$PatchedLibraryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="wordpress" />
<option name="myItemType" value="com.jetbrains.php.projectView.PhpTreeStructureProvider$1" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="atravelblog" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="External Libraries" />
<option name="myItemType" value="com.jetbrains.php.config.PhpExternalLibrariesNodePatcher$PatchedExternalLibrariesNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="PHP" />
<option name="myItemType" value="com.jetbrains.php.config.PhpExternalLibrariesNodePatcher$PatchedLibraryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="wordpress" />
<option name="myItemType" value="com.jetbrains.php.projectView.PhpTreeStructureProvider$1" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="wp-content" />
<option name="myItemType" value="com.jetbrains.php.projectView.PhpTreeStructureProvider$1" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="atravelblog" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="External Libraries" />
<option name="myItemType" value="com.jetbrains.php.config.PhpExternalLibrariesNodePatcher$PatchedExternalLibrariesNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="PHP" />
<option name="myItemType" value="com.jetbrains.php.config.PhpExternalLibrariesNodePatcher$PatchedLibraryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="wordpress" />
<option name="myItemType" value="com.jetbrains.php.projectView.PhpTreeStructureProvider$1" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="wp-content" />
<option name="myItemType" value="com.jetbrains.php.projectView.PhpTreeStructureProvider$1" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="themes" />
<option name="myItemType" value="com.jetbrains.php.projectView.PhpTreeStructureProvider$1" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="atravelblog" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="External Libraries" />
<option name="myItemType" value="com.jetbrains.php.config.PhpExternalLibrariesNodePatcher$PatchedExternalLibrariesNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="PHP" />
<option name="myItemType" value="com.jetbrains.php.config.PhpExternalLibrariesNodePatcher$PatchedLibraryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="wordpress" />
<option name="myItemType" value="com.jetbrains.php.projectView.PhpTreeStructureProvider$1" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="wp-content" />
<option name="myItemType" value="com.jetbrains.php.projectView.PhpTreeStructureProvider$1" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="themes" />
<option name="myItemType" value="com.jetbrains.php.projectView.PhpTreeStructureProvider$1" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="hitchcock" />
<option name="myItemType" value="com.jetbrains.php.projectView.PhpTreeStructureProvider$1" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
@ -116,7 +228,6 @@
</PATH>
</subPane>
</pane>
<pane id="Scope" />
<pane id="Scratches" />
</panes>
</component>
@ -151,6 +262,12 @@
<method />
</configuration>
<configuration default="true" type="js.build_tools.gulp" factoryName="Gulp.js">
<node-interpreter>project</node-interpreter>
<node-options />
<gulpfile />
<tasks />
<arguments />
<envs />
<method />
</configuration>
<configuration default="true" type="js.build_tools.npm" factoryName="npm">
@ -177,6 +294,9 @@
<component name="ShelveChangesManager" show_recycled="false">
<option name="remove_strategy" value="false" />
</component>
<component name="SvnConfiguration">
<configuration />
</component>
<component name="TaskManager">
<task active="true" id="Default" summary="Default task">
<changelist id="f4814905-d0bb-4804-a501-969ee4335bd0" name="Default" comment="" />
@ -184,32 +304,33 @@
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1473509435154</updated>
<workItem from="1473509436732" duration="7459000" />
<workItem from="1473509436732" duration="8060000" />
<workItem from="1473603181236" duration="919000" />
</task>
<servers />
</component>
<component name="TimeTrackingManager">
<option name="totallyTimeSpent" value="7459000" />
<option name="totallyTimeSpent" value="8979000" />
</component>
<component name="ToolWindowManager">
<frame x="0" y="0" width="1920" height="1061" extended-state="0" />
<editor active="true" />
<layout>
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.15709811" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.16649269" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
<window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="true" content_ui="tabs" />
<window_info id="Database" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
<window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
<window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="true" content_ui="tabs" />
<window_info id="Database" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
<window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="true" content_ui="tabs" />
<window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" />
<window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
<window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
<window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
<window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
<window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
<window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
<window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
</layout>
@ -233,27 +354,42 @@
<watches-manager />
</component>
<component name="editorHistoryManager">
<entry file="file://$PROJECT_DIR$/single-Urlaub.php">
<entry file="file://$PROJECT_DIR$/single.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="735">
<caret line="88" column="26" selection-start-line="88" selection-start-column="26" selection-end-line="88" selection-end-column="26" />
<state relative-caret-position="0">
<caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding>
<marker date="1473604097167" expanded="true" signature="2810:2850" ph="..." />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/single-Urlaub.php" />
<entry file="file://$USER_HOME$/wordpress/wp-content/themes/hitchcock/functions.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="121">
<caret line="229" column="21" selection-start-line="229" selection-start-column="21" selection-end-line="229" selection-end-column="21" />
<folding>
<marker date="1466243448000" expanded="true" signature="3970:4060" ph="..." />
<marker date="1466243448000" expanded="true" signature="4012:4051" ph="{...}" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/functions.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="705">
<caret line="47" column="0" selection-start-line="47" selection-start-column="0" selection-end-line="47" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/single.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="316">
<caret line="99" column="109" selection-start-line="99" selection-start-column="109" selection-end-line="99" selection-end-column="109" />
<state relative-caret-position="661">
<caret line="165" column="37" selection-start-line="165" selection-start-column="37" selection-end-line="165" selection-end-column="37" />
<folding>
<element signature="n#style#0;n#div#0;n#div#3;n#div#3;n#div#0;n#div#0;n#div#0;n#!!top" expanded="true" />
<marker date="1473535928504" expanded="true" signature="3243:3283" ph="..." />
<marker date="1473535928504" expanded="true" signature="3476:3566" ph="..." />
<marker date="1473535928504" expanded="true" signature="3548:3566" ph="..." />
<marker date="1473535928504" expanded="true" signature="3706:3730" ph="..." />
<marker date="1473535928504" expanded="true" signature="4036:4273" ph="..." />
<marker date="1473535928504" expanded="true" signature="4247:4273" ph="..." />
<marker date="1473535928504" expanded="true" signature="4659:4730" ph="..." />
<marker date="1473604097167" expanded="true" signature="2810:2850" ph="..." />
</folding>
</state>
</provider>

View file

@ -19,3 +19,33 @@ function my_acf_google_map_api( $api ){
}
add_filter('acf/fields/google_map/api', 'my_acf_google_map_api');
// Related posts function
function atravelblog_related_posts() {
echo('<div class="related-posts posts section-inner">');
global $post;
if ( get_the_category()[0]->name == 'Urlaub' ){
$tagebuch = get_posts(array(
'category_name' => 'Tagebuch'
));
if ($tagebuch->have_posts()) :
while ( $tagebuch->have_posts() ) : $tagebuch->the_post(); ?>
<?php global $post; ?>
<?php get_template_part( 'content', get_post_format() ); ?>
<?php endwhile; ?>
<?php endif; ?>
<div class="clear"></div>
<?php wp_reset_query(); ?>
</div> <!-- /related-posts --> <?php
}
}

View file

@ -89,20 +89,7 @@
</script>
</div>
<h2> Tagebucheinträge in diesem Urlaub: </h2>
<ul>
<?php
$tagebuch = get_posts(array(
'category_name' => 'Tagebuch'
));
foreach($tagebuch as $tb){
if(get_field('urlaub',$tb->ID)->ID === get_the_ID()){
echo('<li><a href="'.get_the_permalink($tb->ID).'" id="post-'.$tb->ID.'"> ');
echo(get_the_title($tb->ID).'</a></li>');
}
}
?>
</ul>
<?php endif; ?>
<?php
@ -176,7 +163,7 @@
</div> <!-- /content -->
<?php hitchcock_related_posts(); ?>
<?php atravelblog_related_posts(); ?>
<?php endwhile; else: ?>